/* ===== Variables & base ===== */
:root {
  --canvas: #FDF4ED;
  --overlay: rgba(0, 0, 0, 0.6);
  --text: #000000;
  --red-clinical: #931818;
  --font-serif: "Noto Serif Display", Georgia, serif;
  --font-sans: "Articulat CF", "Segoe UI", sans-serif;
  --headline-size: clamp(38px, 7vw, 78px);
  --label-size: clamp(16px, 2.2vw, 22px);
  --card-radius: 40px;
  --card-shadow: 0px 20px 70px rgba(0, 0, 0, 0.25);
}

/* Fonts: load from assets if available; fallback to Google Fonts for Noto Serif */
@font-face {
  font-family: "Noto Serif Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/NotoSerifDisplay-Bold.woff2") format("woff2"),
       url("assets/NotoSerifDisplay-Bold.woff") format("woff");
}

@font-face {
  font-family: "Articulat CF";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/ArticulatCF-Bold.woff2") format("woff2"),
       url("assets/ArticulatCF-Bold.woff") format("woff");
}

/* Fallback: use Google Fonts for Noto Serif if local files missing */
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+Display:wght@700&display=swap");

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

html {
  scroll-behavior: smooth;
}

/* Sfondo pagina: crema + texture rumore (sotto tutto, così non è sulle immagini) */
.page-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 100vw;
  min-height: 100vh;
  z-index: -1;
  background-color: var(--canvas);
  /* background-image (rumore) viene impostata in JS */
  background-repeat: repeat;
  pointer-events: none;
}

body {
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Hero (Section 1) ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(12px, 2.5vw, 28px) 0 clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px);
  padding-bottom: 0;
}

.hero__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

.hero__col--text {
  order: 1;
  position: relative;
  display: flex;
  align-items: center;
  margin-top: -4vh;
}

.hero__col--img {
  order: 2;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-width: 0;
}

/* Wrapper per titolo + sottotitolo: stesso spazio, il sottotitolo si sovrappone al titolo */
.hero__text-slot {
  position: relative;
  min-height: 1em;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(38px, 7.2vw, 88px);
  line-height: 1.15;
  color: var(--text);
}

.hero__title--prestige {
  white-space: pre-line;
}

/* Sottotitolo più in basso, circa a metà altezza dell’immagine del carlino */
.hero__subtitle {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 1.05;
  color: var(--text);
  position: absolute;
  top: 22vh;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero__subtitle--price.hero__subtitle--visible {
  opacity: 1;
  visibility: visible;
}

.hero__subtitle-line {
  display: block;
}

.hero__img-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  aspect-ratio: 1;
  margin-right: 0;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.12)) drop-shadow(0 48px 96px rgba(0, 0, 0, 0.08));
}

.hero__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero__img--normal {
  z-index: 2;
}

.hero__img--intubato {
  z-index: 1;
  opacity: 0;
}

/* ===== Card sections (2 & 4) ===== */
.section-card-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
}

/* Card gatto: in flusso normale; la card sale e prende il posto dell’hero (transizione in JS) */
#section-anatomical.section-card-wrap {
  margin-top: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.section-card {
  position: relative;
  width: 90%;
  max-width: 900px;
  min-height: 70vh;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6);
}

.section-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

/* Card naso carlino: più chiara */
.section-card--reflection .section-card__bg {
  filter: brightness(0.78);
}
.section-card--reflection .section-card__overlay {
  background: rgba(0, 0, 0, 0.25);
}

/* Card naso carlino sopra la sezione meticcio così l’ombra non viene tagliata */
#section-reflection.section-card-wrap {
  position: relative;
  z-index: 2;
}

.section-card__text {
  position: relative;
  z-index: 2;
  text-align: center;
  font-weight: 700;
  white-space: pre-line;
  padding: 2rem;
}

.section-card__text--serif {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4.5vw, 44px);
  color: #fff;
}

.section-card__text--sans {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1.05;
  color: #fff;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
}

.section-card__text--sans.section-card__text--visible {
  opacity: 1;
  visibility: visible;
}

/* Etichette diagnosi dentro la card (stessa immagine che si schiarisce) */
.section-card__diagnosis-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.section-card__diagnosis-labels .diagnosis-label {
  opacity: 0;
  visibility: hidden;
}

.section-card__diagnosis-labels .diagnosis-label.diagnosis-label--visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Section 3: spacer (diagnosi integrata nella card) ===== */
.section-diagnosis-spacer {
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.diagnosis-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
}

.diagnosis-label[data-label="lacrimazione"] {
  top: 38%;
  left: 10%;
  flex-direction: row;
  align-items: flex-start;
  transform: rotate(-4deg);
}

.diagnosis-label[data-label="respiratorie"] {
  top: 54%;
  left: 50%;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%) rotate(2deg);
}

.diagnosis-label[data-label="dentali"] {
  bottom: 12%;
  left: 58%;
  flex-direction: column;
  align-items: flex-start;
  transform: rotate(3deg);
}

.diagnosis-label[data-label="respiratorie"] .diagnosis-label__text {
  text-align: center;
}

.diagnosis-label__line {
  display: none;
}

.diagnosis-label__text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(26px, 4.5vw, 48px);
  line-height: 1.05;
  color: #fff;
  text-align: left;
  white-space: pre-line;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.5),
    0 0 36px rgba(255, 255, 255, 0.35),
    0 0 56px rgba(255, 255, 255, 0.2);
}

/* ===== Section 5: Mutt ===== */
.section-mutt {
  min-height: 320vh;
  padding: 0;
  background: transparent;
  margin-top: -12vh;
  position: relative;
  z-index: 1;
}

.section-mutt__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
}

.section-mutt__inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  position: relative;
}

.section-mutt__col--text {
  order: 1;
}

.section-mutt__col--img {
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.section-mutt__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(42px, 8.5vw, 98px);
  line-height: 1.1;
  color: var(--text);
  white-space: pre-line;
}

.section-mutt__subtitle {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(20px, 2.8vw, 30px);
  color: var(--text);
  margin-top: 1rem;
  opacity: 0;
  visibility: hidden;
  position: absolute;
}

.section-mutt__subtitle.section-mutt__subtitle--visible {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.section-mutt__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.12)) drop-shadow(0 48px 96px rgba(0, 0, 0, 0.08));
}

/* Overlay punchline: testi SOPRA al cane, sulla zona corpo (stesso livello, uno al posto dell’altro) */
.section-mutt__punchline {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 2rem;
  padding-top: 62vh;
  opacity: 0;
  visibility: hidden;
}

.section-mutt__punchline.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Stesso livello: intro e perfect sovrapposti, prima uno poi l’altro */
.section-mutt__punchline-intro,
.section-mutt__punchline-perfect {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 68vh;
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  margin: 0;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.85),
    0 0 24px rgba(255, 255, 255, 0.6),
    0 0 40px rgba(255, 255, 255, 0.4);
}

.section-mutt__punchline-intro {
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  max-width: 720px;
}

.section-mutt__punchline-perfect {
  font-size: clamp(36px, 5vw, 64px);
}

.section-mutt__punchline-headline {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--headline-size);
  line-height: 1.15;
  color: var(--text);
  text-align: center;
  max-width: 900px;
  opacity: 0;
  visibility: hidden;
}

/* Section 6: spacer minimo (dopo il pin) */
.section-punchline-spacer {
  min-height: 0;
  height: 0;
  overflow: hidden;
}

/* ===== Divisore: linea animata dal centro ===== */
.section-divider {
  padding: clamp(32px, 6vh, 56px) clamp(24px, 4vw, 48px);
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.section-divider__line {
  display: block;
  width: 100%;
  max-width: 200px;
  height: 1px;
  background: var(--text);
  opacity: 0.5;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.6s ease-out;
}

.section-divider.is-visible .section-divider__line {
  transform: scaleX(1);
}

/* ===== Section 7: Horizontal Parade ===== */
.section-horizontal {
  min-height: 100vh;
  position: relative;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.section-horizontal__title {
  position: absolute;
  top: clamp(24px, 6vh, 56px);
  left: 0;
  right: 0;
  z-index: 1;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--headline-size);
  line-height: 1.15;
  color: var(--text);
  text-align: center;
  white-space: pre-line;
  padding: 0 clamp(24px, 4vw, 48px);
}

.section-horizontal__track-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100vh;
  margin-left: -50vw;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  z-index: 2;
}

.section-horizontal__track {
  display: flex;
  will-change: transform;
  height: 100%;
}

.section-horizontal__img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  object-position: left center;
}

/* ===== Section 8: CTA ===== */
.section-cta {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  margin-top: -95vh;
  background: transparent;
}

.section-cta__text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(22px, 3vw, 38px);
  color: var(--text);
  text-align: center;
}

/* ===== Responsive (< 768px) ===== */
@media (max-width: 767px) {
  .hero__inner,
  .section-mutt__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__col--img {
    order: 1;
  }

  .hero__col--text {
    order: 2;
  }

  .section-mutt__col--img {
    order: 1;
  }

  .section-mutt__col--text {
    order: 2;
  }

  .hero__img-wrap {
    max-width: 85vw;
  }

  .section-card {
    min-height: 60vh;
    width: 95%;
  }

  .diagnosis-label[data-label="lacrimazione"] {
    top: 35%;
    right: 58%;
  }

  .diagnosis-label[data-label="respiratorie"] {
    top: 50%;
  }

  .diagnosis-label[data-label="dentali"] {
    bottom: 28%;
  }

  .section-horizontal__track {
    min-height: 300px;
  }

  .section-horizontal__img {
    min-height: 300px;
  }
}
