/* ==========================================================================
   HERO — fullscreen, tipografia come protagonista assoluto
   Layout: contenuto ancorato al terzo inferiore, stile editoriale
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(var(--space-12), 9vw, var(--space-32));
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Layout split — contenuto a sinistra, foto a destra
   -------------------------------------------------------------------------- */

.hero--has-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  padding: 0;
  min-height: 100dvh;
}

/* Nessun gradiente overlay — la foto è separata dal testo */
.hero--has-image::before {
  display: none;
}

/* Colonna sinistra: contenuto */
.hero--has-image .hero__inner {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(72px + var(--space-8));
  padding-bottom: clamp(var(--space-12), 9vw, var(--space-32));
  padding-left: var(--section-padding-x);
  padding-right: var(--space-16);
  position: relative;
  z-index: var(--z-raised);
  max-width: none;
  background-color: var(--color-bg);
}

/* Colonna destra: foto */
.hero--has-image .hero__bg {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  inset: auto;
  z-index: 0;
  overflow: hidden;
}

.hero--has-image .hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.75);
}

/* Curtain reveal — maschera che scorre via all'apertura pagina (solo desktop, split layout)
   Stato di riposo: scaleY(0) = invisibile. Se JS non parte, la foto resta semplicemente visibile. */
.hero__bg-curtain {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-bg);
  transform-origin: bottom center;
  transform: scaleY(0);
  pointer-events: none;
}

/* Scroll indicator — già absolute, si posiziona in basso a destra della foto */

/* --------------------------------------------------------------------------
   Immagine background (layout senza split, fallback)
   -------------------------------------------------------------------------- */

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.6) brightness(0.55);
}

/* --------------------------------------------------------------------------
   Contenuto principale
   -------------------------------------------------------------------------- */

.hero__inner {
  position: relative;
  z-index: var(--z-raised);
  max-width: var(--max-width);
  width: 100%;
}

/* --------------------------------------------------------------------------
   Eyebrow
   -------------------------------------------------------------------------- */

.hero .eyebrow {
  margin-bottom: var(--space-8);
  /* initial state for JS animation */
  opacity: 0;
  transform: translateY(12px);
}

/* --------------------------------------------------------------------------
   Titolo — cuore del design
   Il contrasto tra "Semplicemente" (leggero, corsivo) e "Uomo" (grande, dritto)
   è la scelta stilistica principale. NON rendere le due righe della stessa taglia.
   -------------------------------------------------------------------------- */

.hero__title {
  display: block;
  margin-bottom: var(--space-8);
}

.hero__title-line {
  display: block;
  overflow: hidden; /* contenitore per il reveal clip dei char */
}

/* "Semplicemente" — Cormorant 300 italic, delicato */
.hero__title-line--sub {
  font-family: var(--font-display);
  font-weight: var(--font-light);
  font-style: italic;
  font-size: clamp(2rem, 6.5vw, 5rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

/* "Uomo" — Cormorant 400 upright, dominante */
.hero__title-line--main {
  font-family: var(--font-display);
  font-weight: var(--font-regular);
  font-style: normal;
  font-size: clamp(5rem, 16.5vw, 12rem);
  line-height: 0.88;
  letter-spacing: var(--tracking-tightest);
  color: var(--color-text-primary);
  margin-top: -0.08em; /* stacking serrato — le due righe formano un blocco unico */
}

/* SplitType genera .char — ogni carattere è un inline-block animabile */
.hero__title .char {
  display: inline-block;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Separatore gold — linea animata tra titolo e tagline
   -------------------------------------------------------------------------- */

.hero__rule {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--color-gold);
  transform-origin: left center;
  transform: scaleX(0);
  margin-bottom: var(--space-8);
}

/* --------------------------------------------------------------------------
   Tagline
   -------------------------------------------------------------------------- */

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(var(--text-base), 1.6vw, var(--text-md));
  font-weight: var(--font-medium);
  font-style: italic;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-secondary);
  line-height: var(--leading-loose);
  max-width: 420px;
  margin-bottom: var(--space-10);
  opacity: 0;
  transform: translateY(16px);
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */

.hero__cta {
  opacity: 0;
  transform: translateY(16px);
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   Scroll indicator — bordo destro, verticale
   -------------------------------------------------------------------------- */

.hero__scroll-indicator {
  position: absolute;
  right: var(--section-padding-x);
  bottom: clamp(var(--space-8), 5vw, var(--space-16));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  z-index: var(--z-raised);
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 56px;
  background: linear-gradient(
    to bottom,
    rgba(247, 243, 236, 0.5),
    var(--color-gold)
  );
  transform-origin: top center;
  transform: scaleY(0);
  animation: scrollLineGrow 1s var(--ease-out-expo) 2s forwards;
}

.hero__scroll-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(247, 243, 236, 0.9);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0;
  animation: fadeInSlow 0.8s var(--ease-out-expo) 2.6s forwards;
}

@keyframes scrollLineGrow {
  to { transform: scaleY(1); }
}

@keyframes fadeInSlow {
  to { opacity: 1; }
}

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

@media (max-width: 768px) {
  /* ====================================================================
     HERO MOBILE — full-bleed immersivo.
     La fotografia È lo sfondo (a tutto schermo); il testo le sta sopra,
     reso leggibile da uno scrim scuro che sale dal basso. Più premium
     dello stack foto+blocco-testo, e fa respirare il ritratto del salone.
     ==================================================================== */
  .hero--has-image {
    display: block;
    position: relative;
    min-height: 100dvh;
    padding: 0;
  }

  /* Foto a tutto schermo */
  .hero--has-image .hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }
  .hero--has-image .hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
    filter: saturate(0.82) brightness(0.74);
  }

  /* Scrim scuro dal basso → leggibilità testo, foto ancora viva in alto */
  .hero--has-image::before {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
      to top,
      rgba(20, 18, 16, 0.90) 0%,
      rgba(20, 18, 16, 0.55) 38%,
      rgba(20, 18, 16, 0.10) 66%,
      rgba(20, 18, 16, 0.34) 100%
    );
  }

  /* Contenuto sovrapposto, ancorato in basso */
  .hero--has-image .hero__inner {
    position: relative;
    z-index: var(--z-raised);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100dvh;
    background: transparent;
    padding-top: calc(60px + var(--space-8));
    padding-bottom: clamp(var(--space-12), 13vw, var(--space-24));
    padding-left: var(--section-padding-x);
    padding-right: var(--section-padding-x);
  }

  /* Testo chiaro sulla foto */
  .hero--has-image .hero__title-line--sub,
  .hero--has-image .hero__title-line--main {
    color: var(--color-text-inverse);
  }
  .hero--has-image .hero__tagline {
    color: rgba(247, 243, 236, 0.88);
    max-width: 100%;
  }

  .hero .eyebrow {
    margin-bottom: var(--space-5);
    color: var(--color-gold-light);
  }
  .hero .eyebrow::before {
    background: var(--color-gold-light);
  }

  .hero__title {
    margin-bottom: var(--space-6);
  }

  .hero__title-line--sub {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .hero__title-line--main {
    font-size: clamp(4rem, 19vw, 6.5rem);
  }

  .hero__rule {
    margin-bottom: var(--space-6);
  }

  .hero__tagline {
    margin-bottom: var(--space-8);
  }

  /* Indicatore scroll: resta nascosto, il testo occupa già il fondo */
  .hero--has-image .hero__scroll-indicator,
  .hero__scroll-indicator {
    display: none;
  }

  /* Curtain reveal solo desktop — su mobile la foto è già full-bleed sotto lo scrim */
  .hero__bg-curtain {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__title-line--sub {
    font-size: clamp(1.5rem, 8.5vw, 2.25rem);
  }

  .hero__title-line--main {
    font-size: clamp(3.5rem, 21vw, 5rem);
  }
}

/* --------------------------------------------------------------------------
   Reduced motion — hero senza animazioni
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow,
  .hero__tagline,
  .hero__cta {
    opacity: 1;
    transform: none;
  }

  .hero__rule {
    transform: scaleX(1);
  }

  .hero__scroll-line {
    transform: scaleY(1);
    animation: none;
  }

  .hero__scroll-label {
    opacity: 1;
    animation: none;
  }
}
