/* ============================================================
   Cascata d'Otro — Landing Page
   ============================================================ */

:root {
  --cream: #f9f7f2;   /* sfondo pagina / navbar (rgb 249,247,242) */
  --ink:   #000000;   /* nero: testo, bottoni, footer, topbar */
  --white: #ffffff;

  --content: 1770px;                          /* 1920 - 75px per lato */
  --gutter:  clamp(1.25rem, 4vw, 75px);       /* margine laterale (max 75px) */
  --radius:  16px;                            /* raggio hero/gallery/footer */
  --gap:     20px;                            /* gap griglia gallery */

  --font-display: "Kaisei Opti", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Container ---------- */
.container {
  width: min(var(--content), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* ============================================================
   Topbar  —  Figma: H54, DM Sans 500 / 20px / LH32 / LS0, bianco
   ============================================================ */
.topbar {
  background: var(--ink);
  color: var(--white);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: clamp(0.85rem, 1.4vw, 12px);
  line-height: 16px;
  letter-spacing: 0;
  text-align: center;
  padding-inline: 1rem;
}

/* ============================================================
   Navbar  —  Figma: H129, bg crema, brand centrato, bottone dx
   ============================================================ */
.navbar {
  position: relative;
  min-height: 129px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Brand = emblema + wordmark, centrato (lockup Figma y86–152) */
.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;                 /* Figma: wordmark quasi a contatto con l'emblema */
  color: var(--ink);
}
.brand__mark { width: 155px; height: auto; }   /* Figma: 155×48 */
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;      /* Figma: LH32 */
  letter-spacing: -0.24px;
}

/* ============================================================
   Bottoni (pill)  —  Figma: pad 16/32, H64, radius 64,
                      DM Sans 400 / 20px / LH32 / LS-0.2, bianco
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 400;                     /* Figma: DMSans-Regular */
  font-size: clamp(1rem, 1.3vw, 14px);
  line-height: 32px;                    /* 16 + 32 + 16 = H64 */
  letter-spacing: -0.2px;
  border-radius: 999px;                 /* Figma radius 64 = pill pieno */
  padding: 16px 32px;
  white-space: nowrap;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.3s ease;
}
.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ============================================================
   Hero  —  Figma: 1771×782, radius 16, attaccato alla navbar
   ============================================================ */
.hero__img {
  width: 100%;
  aspect-ratio: 1771 / 782;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ============================================================
   Intro (titolo + testo + cta)  —  testo centrato
   ============================================================ */
.intro { text-align: center; }

.intro__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5.2vw, 32px);  /* Figma 64px */
  line-height: 1.1;                     /* interlinea come da render Figma (≈70px) */
  letter-spacing: -0.64px;              /* Figma -0.64px */
  margin: 70px 0 0;                     /* hero → titolo (centro blocco a y≈1105) */
}

.intro__text {
  max-width: 1042px;                    /* Figma: box testo 1042px */
  margin: 78px auto 0;                  /* titolo → paragrafo (paragrafo a y≈1254) */
  font-size: clamp(1.05rem, 1.6vw, 18px); /* Figma 24px */
  line-height: 24px;                    /* Figma LH32 */
}
.intro__text p { margin: 0; }
.intro__text p + p { margin-top: 30px; } /* Figma paragraphSpacing 30 */
.intro__text strong { font-weight: 600; } /* Figma: SemiBold */

.intro__cta { margin-top: 63px; }        /* paragrafo → bottone: 63px */

/* ============================================================
   Gallery  —  Figma: titolo LH52 sx + griglia (1 grande + 2×2)
   ============================================================ */
.gallery-section { margin-top: 73px; }   /* bottone → "Gallery": 73px */

.gallery__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5.2vw, 32px);  /* Figma 64px */
  line-height: 52px;                    /* Figma LH52 */
  letter-spacing: -0.64px;
  margin: 0 0 50px;                     /* "Gallery" → griglia: 99px */
}

.gallery {
  display: grid;
  grid-template-columns: 856fr 436fr 436fr; /* Figma: 856 / 436 / 436 */
  gap: var(--gap);                          /* Figma: 20px */
}
.gallery__item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 436 / 310;                  /* tile piccole Figma 436×310 */
}
.gallery__item--big {
  grid-column: 1;
  grid-row: 1 / span 2;                     /* Figma: 856×640, 2 righe */
  aspect-ratio: auto;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Footer  —  Figma: 1783×128, nero, radius 16, testo 24px bianco
   ============================================================ */
footer {
  margin-top: 127px;                    /* griglia → footer: 127px */
  padding-bottom: 29px;                 /* footer → fondo pagina: 29px */
}
.footer {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  min-height: 32px;                    /* Figma H128 (pad V ≈ 48) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
}
.footer__text {
  margin: 0;
  text-align: center;
  font-size: clamp(0.9rem, 1.5vw, 16px);
  line-height: 14px;
}

/* ============================================================
   Mobile — sotto 768px
   ============================================================ */
@media (max-width: 768px) {
  .topbar { height: 44px; line-height: 1.2; }

  .navbar { min-height: 84px; justify-content: space-between; }
  .brand {
    position: static;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .brand__mark { width: 92px; }
  .brand__name { font-size: 18px; line-height: 1.1; }
  .btn { padding: 12px 24px; line-height: 1.4; }

  /* Ritmo verticale compresso su mobile */
  .intro__title { line-height: 1.08; margin-top: 40px; }
  .intro__text  { margin-top: 28px; }
  .intro__cta   { margin-top: 32px; }
  .gallery-section { margin-top: 48px; }
  .gallery__title  { line-height: 1.05; margin-bottom: 24px; }
  footer { margin-top: 48px; }

  /* Griglia: immagine grande in cima, poi 2 colonne */
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery__item--big {
    grid-column: 1 / -1;
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 480px) {
  .brand__name { display: none; }        /* solo emblema su schermi stretti */
  .gallery { grid-template-columns: 1fr; }
  .gallery__item { aspect-ratio: 3 / 2; }
}
