/* ==========================================================
   Accademia dei Fiumi — stile
   Tutte le misure derivano dal PDF (A4 = 595pt di larghezza):
   1 unità --u = 1pt del documento, scalata sulla larghezza
   della finestra e limitata fra un minimo e un massimo.
   ========================================================== */

:root {
  --blue: #1375bb;
  --blue-dark: #0e5c93;
  --green: #36b44a;
  --orange: #faaf3f;
  --ink: #000;
  --paper: #fff;

  /* 1pt del PDF -> px schermo */
  --u: clamp(0.62px, calc(100vw / 595), 1.6px);
  /* scala delle onde: mai troppo piccole su mobile */
  --w: max(var(--u), 0.8px);

  --font: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* il footer verde si estende fino al fondo della finestra */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.footer { flex: 1 0 auto; }
.hero, .waves, .content { flex: none; }

/* ---------- Header: stemma + logotipo ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(76 * var(--u)) 16px 0;
  text-align: center;
}

.hero__crest {
  display: block;
  width: max(48px, calc(36 * var(--u)));
  height: auto;
}

.hero__title {
  margin: calc(9 * var(--u)) 0 0;
  font-weight: 700;
  font-size: max(26px, calc(19.13 * var(--u)));
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* ---------- Onde ---------- */
.waves {
  width: 100%;
  height: calc(34 * var(--w));
  background-repeat: repeat-x;
  background-position: center top;
  background-size: calc(81.2 * var(--w)) 100%;
}

/* due linee blu parallele */
.waves--top {
  margin-top: calc(24 * var(--u));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 81.2 34' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%231375bb' stroke-width='1.417'%3E%3Cpath d='M-61.8 9.5q20.3-16 40.6 0t40.6 0 40.6 0 40.6 0 40.6 0 40.6 0'/%3E%3Cpath d='M-61.8 23.8q20.3-16 40.6 0t40.6 0 40.6 0 40.6 0 40.6 0 40.6 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* linea blu + onda verde piena che introduce il footer */
.waves--bottom {
  margin-top: calc(22 * var(--u));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 81.2 34' preserveAspectRatio='none'%3E%3Cpath fill='%2336b44a' d='M-61.8 23.7q20.3 16 40.6 0t40.6 0 40.6 0 40.6 0 40.6 0 40.6 0V35H-61.8z'/%3E%3Cpath fill='none' stroke='%231375bb' stroke-width='1.417' d='M-61.8 9.5q20.3 16 40.6 0t40.6 0 40.6 0 40.6 0 40.6 0 40.6 0'/%3E%3C/svg%3E");
}

/* ---------- Testo ---------- */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(12 * var(--u)) 20px 0;
  text-align: center;
}

.content p {
  max-width: 34em;
  margin: 0 0 1em;
  font-size: max(17px, calc(14 * var(--u)));
  line-height: 0.98;
  hyphens: manual;
}

.content p:last-of-type { margin-bottom: 0; }

/* ---------- Bottone ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max(76px, calc(56 * var(--u)));
  min-height: max(32px, calc(22.6 * var(--u)));
  margin-top: calc(25 * var(--u));
  padding: 0 max(12px, calc(8 * var(--u)));
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: max(13px, calc(9.16 * var(--u)));
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: -1px; /* evita la riga di giunzione con l'onda */
  padding: calc(13 * var(--u)) 16px calc(55 * var(--u));
  background: var(--green);
  color: #fff;
  text-align: center;
  font-size: max(14px, calc(10 * var(--u)));
  line-height: 1;
}

.footer address {
  font-style: normal;
  line-height: 1;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s ease;
}

.footer a:hover,
.footer a:focus-visible { border-bottom-color: #fff; outline: none; }

.footer__copy {
  margin: 1em 0 0;
}

/* ---------- Animazione d'ingresso ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

/* Tablet e mobile: le righe spezzate del PDF lasciano il posto
   al ritorno a capo naturale, con interlinea più ariosa. */
@media (max-width: 759px) {
  .lb { display: none; }

  .content p {
    max-width: 30em;
    line-height: 1.3;
  }

  .hero__title { line-height: 1; }
  .footer, .footer address { line-height: 1.35; }
  .footer { padding-top: 20px; padding-bottom: 48px; }
}

@media (max-width: 400px) {
  .content { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
