/* ============================================
   COSÌ SIA – Nomadi Tribute Band
   Design ispirato allo spirito Nomadi
   (texture scura, accenti rossi, eleganza rock)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root {
  --bg-dark: #0d0d0d;
  --bg-card: #161616;
  --bg-elevated: #1e1e1e;
  --accent: #c41e3a;
  --accent-soft: #e63950;
  --accent-dark: #8b0000;
  --gold: #d4a017;
  --text: #f0f0f0;
  --text-muted: #9a9a9a;
  --text-light: #cfcfcf;
  --border: rgba(255,255,255,0.08);
  --radius: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.55);
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(196,30,58,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(212,160,23,0.04) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, .logo-text strong {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

header {
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  width: 46px;
  height: 46px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(196,30,58,0.3);
}

.logo-text strong {
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: 2px;
}

.logo-text span {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 1px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.15rem;
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: var(--transition);
  border-radius: 3px;
  position: relative;
}

nav a:hover,
nav a.active {
  color: #fff;
  background: rgba(196,30,58,0.15);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.7rem;
  cursor: pointer;
}

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 5rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(13,13,13,0.3) 0%, rgba(13,13,13,0.85) 100%),
    radial-gradient(ellipse at center, rgba(196,30,58,0.12) 0%, transparent 70%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-content h1 {
  font-size: clamp(3.2rem, 9vw, 5.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
  letter-spacing: 4px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

.hero-content .subtitle {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--accent);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
  font-weight: 500;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 560px;
  margin: 0 auto 2.8rem;
  font-weight: 300;
  line-height: 1.7;
}

.btn {
  display: inline-block;
  padding: 0.95rem 2.2rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 24px rgba(196,30,58,0.4);
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(196,30,58,0.55);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
  margin-left: 0.9rem;
}

.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.06);
}

section {
  padding: 5.5rem 1.5rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 0.6rem;
}

.section-title h2 span {
  color: var(--accent);
}

.section-title p {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0.8rem auto 0;
  font-size: 1.05rem;
  font-weight: 300;
}

.section-title .line {
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin: 1rem auto 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-text h3 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}

.about-text strong {
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.6rem 1rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(196,30,58,0.4);
  transform: translateY(-4px);
}

.stat-card .number {
  font-family: 'Oswald', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-card .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 0.4rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.member-card:hover {
  border-color: rgba(196,30,58,0.5);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.member-photo {
  height: 260px;
  background: linear-gradient(160deg, #1a1a1a 0%, #0f0f0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  color: rgba(196,30,58,0.35);
  position: relative;
  overflow: hidden;
}

.member-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 40%);
}

.member-info {
  padding: 1.4rem 1.5rem 1.8rem;
  text-align: center;
}

.member-info h4 {
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.member-info .role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.member-info .link-hint {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
  transition: var(--transition);
}

.member-card:hover .link-hint {
  opacity: 1;
  color: var(--accent);
}

.member-hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.member-hero .photo-large {
  width: 220px;
  height: 220px;
  margin: 0 auto 1.8rem;
  background: linear-gradient(160deg, #1a1a1a, #0f0f0f);
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(196,30,58,0.4);
  box-shadow: 0 0 40px rgba(196,30,58,0.15);
}

.member-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 0.3rem;
}

.member-hero .role {
  font-family: 'Oswald', sans-serif;
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.member-bio {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.member-bio p {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 1.3rem;
  line-height: 1.75;
}

.member-bio h3 {
  color: #fff;
  margin: 2rem 0 1rem;
  font-size: 1.2rem;
}

.member-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.member-gallery .g-item {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(196,30,58,0.3);
  transition: var(--transition);
}

.member-gallery .g-item:hover {
  border-color: var(--accent);
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

.events-tabs {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 2.8rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.65rem 1.7rem;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--text-light);
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 2px;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.events-list {
  display: grid;
  gap: 1.2rem;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.4rem 1.8rem;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: var(--transition);
}

.event-card:hover {
  background: var(--bg-elevated);
  border-left-color: var(--gold);
}

.event-date {
  text-align: center;
}

.event-date .day {
  font-family: 'Oswald', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.event-date .month {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.event-info h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  text-transform: none;
  letter-spacing: 0.3px;
}

.event-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.event-badge {
  padding: 0.35rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}

.badge-future {
  background: rgba(196,30,58,0.18);
  color: var(--accent-soft);
}

.badge-past {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
}

.gallery-item {
  aspect-ratio: 4/3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.gallery-item:hover {
  border-color: rgba(196,30,58,0.5);
  transform: scale(1.02);
}

.gallery-item .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #151515, #0c0c0c);
  color: rgba(196,30,58,0.35);
  font-size: 2.8rem;
}

.gallery-item .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 2rem 1rem 1rem;
  color: #fff;
  font-size: 0.88rem;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .caption {
  opacity: 1;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.3rem 1.4rem;
  transition: var(--transition);
}

.contact-item:hover {
  border-color: rgba(196,30,58,0.35);
}

.contact-item .icon {
  width: 46px;
  height: 46px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-item h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  text-transform: none;
  letter-spacing: 0.5px;
}

.contact-item a {
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item a:hover {
  color: var(--accent);
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2.2rem;
}

.contact-form h3 {
  color: #fff;
  margin-bottom: 1.6rem;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
  transition: var(--transition);
  border-radius: 2px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.15);
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

footer {
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  padding: 3.5rem 1.5rem 1.8rem;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-links h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  letter-spacing: 1.5px;
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.05rem;
}

.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.bg-dark {
  background: rgba(0,0,0,0.35);
}

.text-center { text-align: center; }
.mt-2 { margin-top: 2.2rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .social-links { justify-content: center; }
  .footer-brand p { margin-left: auto; margin-right: auto; }
  .event-card {
    grid-template-columns: 80px 1fr;
  }
  .event-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    flex-direction: column;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
  }
  nav ul.open { display: flex; }
  .btn-outline {
    margin-left: 0;
    margin-top: 0.8rem;
  }
  .hero-content .btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0.5rem auto;
  }
  .stats { grid-template-columns: 1fr; }
}

/* ========== LOGO IMAGE ========== */
.logo-img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: var(--transition);
}
.logo:hover .logo-img {
  opacity: 0.9;
  transform: scale(1.03);
}
.logo-text-only {
  display: none; /* hidden when using image logo */
}

/* Footer logo slightly smaller */
footer .logo-img {
  height: 42px;
}

/* ========== HERO PARALLAX ========== */
.hero-photo {
  min-height: 100vh;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background-color: #0d0d0d;
}
.hero-photo .hero-bg {
  position: absolute;
  inset: -10% 0 -10% 0; /* extra height for parallax movement */
  background: url('../img/Cosisia.jpg') center center / cover no-repeat;
  will-change: transform;
  transform: translateY(0);
  transition: transform 0.1s linear;
  z-index: 0;
}
.hero-photo .hero-overlay {
  position: absolute;
  inset: 0;
  /* Overlay più leggero: meno scuro in alto, un po' più presente in basso per leggibilità */
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.18) 70%,
    rgba(0,0,0,0.12) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.hero-photo .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem 4.5rem;
  max-width: 700px;
}
.hero-photo .hero-content p {
  color: #f0f0f0;
  font-size: 1.12rem;
  font-weight: 300;
  margin-bottom: 1.8rem;
  text-shadow: 0 2px 14px rgba(0,0,0,0.75);
  line-height: 1.6;
}
@media (max-width: 768px) {
  .hero-photo {
    min-height: 85vh;
    height: 85vh;
  }
  .hero-photo .hero-content {
    padding-bottom: 3rem;
  }
  .logo-img {
    height: 40px;
  }
}

/* ========== SFONDO FILIGRANA (altre pagine) ========== */
body.has-watermark {
  position: relative;
}
body.has-watermark::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    url('../img/Cosisia.jpg') center center / cover no-repeat;
  filter: blur(8px) brightness(0.35) saturate(0.7);
  transform: scale(1.08); /* evita bordi bianchi dal blur */
  pointer-events: none;
}
/* leggero velo scuro sopra la filigrana per leggibilità */
body.has-watermark::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(8, 8, 8, 0.55);
  pointer-events: none;
}

/* Hero parallax più evidente */
.hero-photo .hero-bg {
  inset: -15% 0 -15% 0;
}

/* ========== LOGO ROTONDO ========== */
.logo-img {
  height: 52px;
  width: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(196,30,58,0.6);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.3);
  display: block;
  transition: var(--transition);
}
.logo:hover .logo-img {
  border-color: var(--accent);
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(196,30,58,0.4);
}
footer .logo-img {
  height: 44px;
  width: 44px;
}

/* ========== BANNER PUBBLICITARI HEADER ========== */
.ad-banner-track {
  flex: 1;
  max-width: 420px;
  height: 36px;
  margin: 0 1rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.ad-banner-track a {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(90deg, rgba(196,30,58,0.25), rgba(212,160,23,0.2));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
  white-space: nowrap;
  padding: 0 1rem;
}
.ad-banner-track a.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.ad-banner-track a.leaving {
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}
@media (max-width: 900px) {
  .ad-banner-track { display: none; }
}

/* ========== PARALLAX BG GLOBAL ========== */
.page-parallax-bg {
  position: fixed;
  inset: -20% 0 -20% 0;
  z-index: -2;
  background: url('../img/Cosisia.jpg') center center / cover no-repeat;
  will-change: transform;
  transform: translate3d(0,0,0);
  pointer-events: none;
}
body.has-watermark .page-parallax-bg {
  filter: blur(10px) brightness(0.32) saturate(0.65);
  transform: scale(1.1) translate3d(0,0,0);
}
body.has-watermark::before,
body.has-watermark::after {
  display: none; /* usiamo il div parallax invece */
}
body.has-watermark .page-parallax-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(8,8,8,0.58);
  pointer-events: none;
}

/* ========== AUDIO PLAYER ========== */
.audio-player {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(20,20,20,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px;
  padding: 0.5rem 0.9rem 0.5rem 0.55rem;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}
.audio-player button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.audio-player button:hover {
  background: var(--accent-soft);
  transform: scale(1.08);
}
.audio-player button.muted {
  background: #444;
}
.audio-player input[type="range"] {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.audio-player input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* ========== SPONSOR PAGE ========== */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.sponsor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.8rem 1.2rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.sponsor-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.sponsor-logo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(135deg, #222, #1a1a1a);
  border: 2px dashed rgba(196,30,58,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
  letter-spacing: 0.5px;
}
.sponsor-card h4 {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 1px;
}
.sponsor-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.sponsor-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 2.5rem;
  margin-top: 3rem;
  border-radius: 6px;
}
.sponsor-cta h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}
.sponsor-cta p, .sponsor-cta ul {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.sponsor-cta ul {
  padding-left: 1.4rem;
}
.sponsor-cta li {
  margin-bottom: 0.4rem;
}

/* ========== MEMBER PHOTO GRID ========== */
.member-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.member-photo-grid img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.member-photo-grid img:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}
.member-hero .photo-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
@media (max-width: 600px) {
  .member-photo-grid {
    grid-template-columns: 1fr;
  }
  .member-photo-grid img {
    height: 240px;
  }
}

.nav-container {
  gap: 0.5rem;
}
.nav-container .logo {
  flex-shrink: 0;
}
.nav-container nav {
  flex-shrink: 0;
}

/* ========== HOME: sfondo fisso che resta visibile allo scroll ========== */
.hero-photo {
  position: relative;
  min-height: 100vh;
  height: auto;
  overflow: visible;
}
.hero-photo .hero-bg {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0;
  background: url('../img/Cosisia.jpg') center center / cover no-repeat;
  transform: none !important; /* fisso, non parallax translate */
}
.hero-photo .hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.25) 45%,
    rgba(0,0,0,0.15) 100%
  );
  pointer-events: none;
}
.hero-photo .hero-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4.5rem;
}
/* Il resto del contenuto della home scorre SOPRA lo sfondo fisso */
body.home-fixed-bg > section:not(.hero-photo),
body.home-fixed-bg > footer {
  position: relative;
  z-index: 3;
  background: rgba(13, 13, 13, 0.92);
}
body.home-fixed-bg > header {
  z-index: 1000;
}

/* ========== FOTO MEMBRO ROTONDA + SHAKE ========== */
.member-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.member-photo.has-img {
  padding: 0;
  overflow: hidden;
}
.member-photo.has-img::after {
  display: none;
}
.member-photo.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
}
@keyframes shake-photo {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-4px) rotate(-2deg); }
  30% { transform: translateX(4px) rotate(2deg); }
  45% { transform: translateX(-3px) rotate(-1.5deg); }
  60% { transform: translateX(3px) rotate(1.5deg); }
  75% { transform: translateX(-2px) rotate(-1deg); }
  90% { transform: translateX(2px) rotate(1deg); }
}
.member-card:hover .member-photo.has-img img {
  animation: shake-photo 0.55s ease-in-out;
}

/* Audio player: solo altoparlante, senza fader */
.audio-player {
  padding: 0.45rem 0.5rem !important;
  gap: 0 !important;
}
.audio-player input[type="range"] {
  display: none !important;
}

/* Altoparlante: verde = attivo, barrato = pausa */
.audio-player button#audio-toggle.is-playing {
  background: #22c55e !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.55);
}
.audio-player button#audio-toggle.is-paused {
  background: #555 !important;
  color: #ccc !important;
  position: relative;
  box-shadow: none;
}
.audio-player button#audio-toggle.is-paused::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 3px;
  background: #e11d48;
  transform: translate(-50%, -50%) rotate(-35deg);
  border-radius: 2px;
  pointer-events: none;
}

/* Volto centrato nei riquadri rotondi componenti */
.member-photo.has-img img.member-photo-img,
.member-photo.has-img img {
  object-fit: cover;
  object-position: center 20%;
  width: 100%;
  height: 100%;
}
.member-hero .photo-large img {
  object-fit: cover;
  object-position: center 20%;
}

/* ========== GALLERY FOTO REALI ========== */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
  cursor: zoom-in;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #111;
}
.gallery-item:hover img {
  transform: scale(1.06);
}
.gallery-item .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #eee;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: zoom-out;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox .lb-content {
  max-width: min(92vw, 1000px);
  max-height: 90vh;
  text-align: center;
  cursor: default;
  transform: scale(0.88);
  transition: transform 0.35s ease;
}
.lightbox.open .lb-content {
  transform: scale(1);
}
.lightbox #lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  user-select: none;
}
.lightbox #lb-caption {
  color: #ccc;
  margin-top: 0.8rem;
  font-size: 0.95rem;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3001;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--accent);
}
.lb-close { top: 1.2rem; right: 1.2rem; font-size: 1.8rem; }
.lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ========== DUAL BANNERS ========== */
.ad-banner-track {
  display: flex !important;
  gap: 0.5rem;
  max-width: 480px;
  height: 36px;
}
.ad-banner-track a {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  flex: 1;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.ad-banner-track a.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ad-banner-track a.leaving {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
@media (max-width: 900px) {
  .ad-banner-track { display: none !important; }
}

/* Home: bottoni più in alto, visibili all'apertura */
.hero-photo .hero-content {
  justify-content: center !important;
  padding-top: 18vh !important;
  padding-bottom: 2rem !important;
  gap: 1.5rem;
}
.hero-photo .hero-content > div {
  margin-top: 0.5rem;
}
@media (max-width: 700px) {
  .hero-photo .hero-content {
    padding-top: 22vh !important;
  }
}

/* Banner: scorrono da destra verso sinistra, dissolvenza in uscita (verso il logo) */
.ad-banner-track {
  display: block !important;
  position: relative;
  flex: 1;
  max-width: 520px;
  height: 36px;
  margin: 0 0.8rem;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 88%, transparent 100%);
}
.ad-banner-track a {
  position: absolute !important;
  top: 0;
  left: 0;
  width: max-content;
  min-width: 220px;
  max-width: 90%;
  height: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(110%);
  pointer-events: none;
  transition: none;
  white-space: nowrap;
  padding: 0 1.1rem;
  background: linear-gradient(90deg, rgba(196,30,58,0.3), rgba(212,160,23,0.22));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
}
.ad-banner-track a.slide-in {
  animation: bannerSlideRTL 5.5s linear forwards;
  pointer-events: auto;
}
@keyframes bannerSlideRTL {
  0% {
    opacity: 0;
    transform: translateX(110%);
  }
  8% {
    opacity: 1;
    transform: translateX(70%);
  }
  75% {
    opacity: 1;
    transform: translateX(-40%);
  }
  100% {
    opacity: 0;
    transform: translateX(-120%);
  }
}
@media (max-width: 900px) {
  .ad-banner-track { display: none !important; }
}

/* Hero CTA sopra il testo */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  margin-bottom: 0.4rem;
}

/* Maps button eventi */
.maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: #fff;
  background: rgba(66, 133, 244, 0.25);
  border: 1px solid rgba(66, 133, 244, 0.55);
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}
.maps-btn:hover {
  background: rgba(66, 133, 244, 0.45);
  border-color: #4285f4;
}

/* Social FB rotondo + WA */
.social-links a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}
.social-links a.social-fb,
.social-links a[title="Facebook"] {
  background: #1877f2;
  color: #fff !important;
}
.social-links a.social-wa,
.social-links a[title="WhatsApp"] {
  background: #25d366;
  color: #fff !important;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
.social-links a:hover {
  transform: scale(1.1);
}

/* Web designer card */
.webdesigner-card .wd-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c41e3a, #8b1528);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Banner lenti, naturali, uno vicino all'altro */
.ad-banner-track {
  display: block !important;
  position: relative;
  flex: 1;
  max-width: 540px;
  height: 36px;
  margin: 0 0.8rem;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}
.ad-banner-track a {
  position: absolute !important;
  top: 0;
  left: 0;
  height: 100%;
  width: max-content;
  min-width: 200px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
  white-space: nowrap;
  padding: 0 1.1rem;
  background: linear-gradient(90deg, rgba(196,30,58,0.3), rgba(212,160,23,0.22));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: none;
}
.ad-banner-track a.slide-in {
  animation: bannerSlowRTL 12s linear forwards;
  pointer-events: auto;
}
.ad-banner-track a.slide-in-2 {
  animation: bannerSlowRTL 12s linear forwards;
  animation-delay: 6s;
  pointer-events: auto;
}
@keyframes bannerSlowRTL {
  0%   { opacity: 0; transform: translateX(105%); }
  6%   { opacity: 1; transform: translateX(85%); }
  88%  { opacity: 1; transform: translateX(-70%); }
  100% { opacity: 0; transform: translateX(-115%); }
}
.ad-banner-track.paused a {
  animation-play-state: paused !important;
}
@media (max-width: 900px) {
  .ad-banner-track { display: none !important; }
}

/* ========== MOBILE: menu a destra, banner al centro ========== */
@media (max-width: 900px) {
  .nav-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.4rem !important;
    padding: 0.55rem 0.75rem !important;
  }
  .nav-container .logo {
    order: 1 !important;
    flex: 0 0 auto !important;
  }
  .ad-banner-track {
    display: block !important;
    order: 2 !important;
    flex: 1 1 auto !important;
    max-width: none !important;
    width: auto !important;
    height: 30px !important;
    margin: 0 0.35rem !important;
    min-width: 0 !important;
  }
  .menu-toggle {
    display: block !important;
    order: 3 !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .nav-container nav {
    order: 4 !important;
  }
  .ad-banner-track a {
    font-size: 0.65rem !important;
    letter-spacing: 0.8px !important;
    padding: 0 0.7rem !important;
    min-width: 140px !important;
  }
}

/* ========== TRIBUTO AUGUSTO DAOLIO ========== */
.augusto-tribute {
  position: relative;
  z-index: 3;
  background: #0a0a0a;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.augusto-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 2rem;
  align-items: center;
}
.augusto-text {
  color: #f0f0f0;
}
.augusto-text h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 3px;
  line-height: 1.25;
  margin: 0 0 1.4rem;
  color: #fff;
}
.augusto-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.7;
  color: #c8c8c8;
  margin: 0 0 1rem;
  font-style: italic;
}
.augusto-sign {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  color: #aaa;
  margin: 0 0 0.8rem;
}
/* Firma Augusto: tratto realistico e fluido (penna + inchiostro) */
.augusto-signature-wrap {
  position: relative;
  display: inline-block;
  max-width: 200px;
  width: 100%;
  margin-top: 0.45rem;
  overflow: visible;
  /* spazio per il alone della penna */
  padding: 4px 8px 8px 0;
}

.augusto-signature {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  position: relative;
  z-index: 1;
  /* inchiostro bianco luminoso */
  filter:
    invert(1)
    brightness(1.25)
    drop-shadow(0 0 1.5px rgba(255,255,255,0.9))
    drop-shadow(0 0 6px rgba(255,255,255,0.45));
  /* bordo morbido del tratto: il gradiente crea l'effetto inchiostro fresco */
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 calc(100% - 14%),
    rgba(0,0,0,0.55) calc(100% - 7%),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 calc(100% - 14%),
    rgba(0,0,0,0.55) calc(100% - 7%),
    transparent 100%
  );
  -webkit-mask-size: 0% 100%;
  mask-size: 0% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  mask-position: left center;
  will-change: mask-size, -webkit-mask-size, filter;
  /* 4s scrittura + 15s tenuta = 19s ciclo
     easing fluido tipo scrittura a mano */
  animation: signatureWrite 19s cubic-bezier(0.33, 0.02, 0.18, 1) infinite;
}

/* punta della penna + scia di inchiostro */
.augusto-pen {
  position: absolute;
  top: 58%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #f5f5f5 40%, transparent 70%);
  box-shadow:
    0 0 4px 1px rgba(255,255,255,0.95),
    0 0 10px 3px rgba(255,255,255,0.55),
    -10px 0 14px 2px rgba(255,255,255,0.2);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transform: translate(-50%, -50%);
  will-change: left, opacity, top;
  animation: penTravel 19s cubic-bezier(0.33, 0.02, 0.18, 1) infinite;
}

/* leggera oscillazione verticale della penna (movimento naturale della mano) */
@keyframes signatureWrite {
  0% {
    -webkit-mask-size: 0% 100%;
    mask-size: 0% 100%;
    filter: invert(1) brightness(1.05) drop-shadow(0 0 1px rgba(255,255,255,0.5));
  }
  /* inizio tratto più deciso */
  4% {
    -webkit-mask-size: 12% 100%;
    mask-size: 12% 100%;
  }
  /* corpo della firma: flusso continuo */
  12% {
    -webkit-mask-size: 42% 100%;
    mask-size: 42% 100%;
    filter: invert(1) brightness(1.2) drop-shadow(0 0 2px rgba(255,255,255,0.7));
  }
  /* rallentamento naturale a metà (come si fa con la penna) */
  15.5% {
    -webkit-mask-size: 55% 100%;
    mask-size: 55% 100%;
  }
  /* finale del tratto / fioritura */
  21% {
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    filter:
      invert(1)
      brightness(1.38)
      drop-shadow(0 0 2px rgba(255,255,255,0.95))
      drop-shadow(0 0 8px rgba(255,255,255,0.5));
  }
  /* 21% ≈ 4s di scrittura → poi 15s di tenuta bianca */
  22%, 97.5% {
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    filter:
      invert(1)
      brightness(1.32)
      drop-shadow(0 0 2px rgba(255,255,255,0.85))
      drop-shadow(0 0 7px rgba(255,255,255,0.4));
  }
  /* dissolvenza breve prima del nuovo tratto */
  99% {
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    filter: invert(1) brightness(1.1) drop-shadow(0 0 1px rgba(255,255,255,0.4));
    opacity: 1;
  }
  100% {
    -webkit-mask-size: 0% 100%;
    mask-size: 0% 100%;
    filter: invert(1) brightness(1.05);
    opacity: 1;
  }
}

@keyframes penTravel {
  0% {
    left: 0%;
    top: 62%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  1.5% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  /* percorso con piccole variazioni verticali (mano reale) */
  4%   { left: 12%; top: 55%; opacity: 1; }
  8%   { left: 28%; top: 48%; }
  12%  { left: 42%; top: 58%; }
  15.5%{ left: 55%; top: 52%; }
  18%  { left: 78%; top: 60%; }
  21%  { left: 100%; top: 54%; opacity: 1; transform: translate(-50%, -50%) scale(1); }
  /* penna si solleva a fine tratto */
  22.5%{ left: 100%; top: 48%; opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  100% { left: 0%; top: 62%; opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
}

.augusto-photos {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.6rem;
  align-items: stretch;
}
.augusto-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}
.augusto-photo-main {
  min-height: 280px;
  max-height: 360px;
}
.augusto-photo-art {
  min-height: 280px;
  max-height: 360px;
}
@media (max-width: 800px) {
  .augusto-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .augusto-photos {
    grid-template-columns: 1fr 1fr;
  }
  .augusto-photo-main,
  .augusto-photo-art {
    min-height: 200px;
    max-height: 260px;
  }
  .augusto-text h2 {
    letter-spacing: 2px;
  }
}
@media (max-width: 480px) {
  .augusto-photos {
    grid-template-columns: 1fr;
  }
}

/* ========== LOCANDA EVENTO – grande, vento da dietro, bordi soft ========== */
.event-poster {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 90;
  width: min(240px, 42vw);
  max-width: 260px;
  perspective: 900px;
  transform-origin: top center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  /* alone morbido, senza bordo netto */
  filter: drop-shadow(3px 12px 18px rgba(0,0,0,0.5));
  transition: opacity 0.3s ease;
  background: transparent;
  border: none;
}
.event-poster.flying {
  pointer-events: none;
  z-index: 200;
}

.event-poster-inner {
  position: relative;
  transform-origin: top center;
  /* oscillazione fluida + ondulazione come vento da dietro */
  animation: posterWind 7s ease-in-out infinite;
  will-change: transform;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  /* nessun box-shadow duro: solo soft glow */
  box-shadow: none;
}

.event-poster img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  /* bordi trasparenti / sfumati */
  -webkit-mask-image: radial-gradient(
    ellipse 92% 94% at 50% 48%,
    #000 62%,
    rgba(0,0,0,0.85) 78%,
    rgba(0,0,0,0.4) 90%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 92% 94% at 50% 48%,
    #000 62%,
    rgba(0,0,0,0.85) 78%,
    rgba(0,0,0,0.4) 90%,
    transparent 100%
  );
  /* leggera curvatura prospettica del foglio */
  border-radius: 2px;
  transform-style: preserve-3d;
}

/* puntine di fissaggio in alto (spigoli) */
.event-poster::before,
.event-poster::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0f0f0, #999 50%, #555);
  box-shadow: 0 1px 4px rgba(0,0,0,0.55);
  z-index: 3;
}
.event-poster::before { left: 14px; }
.event-poster::after  { right: 14px; }

/*
  Vento da dietro:
  - rotazione sui 3 assi
  - leggero scale orizzontale (gonfiaggio del foglio)
  - skew per ondulazione
  Ciclo lungo e easing morbido = movimento fluido
*/
@keyframes posterWind {
  0% {
    transform:
      rotateZ(-2.5deg)
      rotateY(-8deg)
      rotateX(2deg)
      skewX(-1.5deg)
      scaleX(0.98) scaleY(1.01);
  }
  20% {
    transform:
      rotateZ(-0.5deg)
      rotateY(-2deg)
      rotateX(-1deg)
      skewX(-0.3deg)
      scaleX(1.01) scaleY(0.995);
  }
  40% {
    transform:
      rotateZ(2deg)
      rotateY(6deg)
      rotateX(1.5deg)
      skewX(1.2deg)
      scaleX(0.985) scaleY(1.008);
  }
  60% {
    transform:
      rotateZ(3.2deg)
      rotateY(9deg)
      rotateX(-2deg)
      skewX(1.8deg)
      scaleX(1.015) scaleY(0.99);
  }
  80% {
    transform:
      rotateZ(0.8deg)
      rotateY(2deg)
      rotateX(1deg)
      skewX(0.4deg)
      scaleX(0.99) scaleY(1.005);
  }
  100% {
    transform:
      rotateZ(-2.5deg)
      rotateY(-8deg)
      rotateX(2deg)
      skewX(-1.5deg)
      scaleX(0.98) scaleY(1.01);
  }
}

@keyframes posterFlyAway {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  35% {
    transform: translate(-30vw, -12vh) rotate(-18deg) scale(0.97);
    opacity: 0.95;
  }
  100% {
    transform: translate(-110vw, -45vh) rotate(-75deg) scale(0.35);
    opacity: 0;
  }
}
.event-poster.flying {
  animation: posterFlyAway 1.2s cubic-bezier(0.22, 0.08, 0.2, 1) forwards;
}
.event-poster.flying .event-poster-inner {
  animation: none;
}

@media (max-width: 700px) {
  .event-poster {
    top: 62px;
    right: 12px;
    width: min(180px, 40vw);
  }
}
@media (max-width: 420px) {
  .event-poster {
    width: min(140px, 38vw);
    right: 8px;
  }
}

