/* ==========================================================================
   Gwendalina Beauty — home.css
   Stili specifici della Home (index.html). Token, reset e componenti
   condivisi vivono in global.css: qui solo layout e dettagli di pagina.
   Contratto: docs/DESIGN-SYSTEM.md §5.1
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */

.hero {
  --hero-pad-bottom: clamp(3.5rem, 9vh, 7rem);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  /* Visibile quando la scrub riduce il media a .92 e ne arrotonda gli angoli */
  background-color: var(--color-ivory);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--color-espresso);
  will-change: transform, border-radius;
}

/* L'overlay vive dentro .hero__media: segue scala e raggio del media durante la scrub */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(27, 23, 20, .55), rgba(27, 23, 20, .30) 50%, rgba(27, 23, 20, .35));
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-height) + var(--space-7));
  padding-bottom: var(--hero-pad-bottom);
}

.hero .eyebrow {
  margin-bottom: var(--space-3);
  color: var(--color-ivory);
}

.hero__title { max-width: 16ch; }

.hero .lead {
  max-width: 44ch;
  margin-top: var(--space-4);
  color: rgba(247, 243, 238, .92);
}

.hero__actions { margin-top: var(--space-5); }

/* Indicatore di scorrimento: in basso a destra, allineato alla riga delle CTA (solo desktop) */
.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--hero-pad-bottom) + 2px);
  display: none;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(247, 243, 238, .78);
  transition: color var(--dur-fast) var(--ease-out);
}

.hero__scroll-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  animation: hero-scroll-bob 2.4s var(--ease-in-out) infinite;
}

@keyframes hero-scroll-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (hover: hover) {
  .hero__scroll:hover { color: var(--color-ivory); }
}

@media (min-width: 992px) {
  .hero__scroll { display: inline-flex; }
}

/* Stato iniziale con JS: gli elementi che la timeline dell'hero porta a opacity 1.
   Le parole del titolo sono già nel markup (.word), così non c'è flash prima di GSAP. */
html.js:not(.no-anim) .hero .eyebrow,
html.js:not(.no-anim) .hero .lead,
html.js:not(.no-anim) .hero__actions > *,
html.js:not(.no-anim) .hero__scroll,
html.js:not(.no-anim) .hero__overlay,
html.js:not(.no-anim) .hero__title .word { opacity: 0; }


/* --------------------------------------------------------------------------
   2. Manifesto
   -------------------------------------------------------------------------- */

.manifesto { padding-block: calc(var(--section-spacing) + var(--space-6)); }

.manifesto__text {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--color-ink);
}

.manifesto__text em {
  font-style: italic;
  font-weight: 300;
}

.manifesto__sentence { display: block; }

.manifesto__sentence + .manifesto__sentence { margin-top: .75em; }

@media (min-width: 768px) {
  .manifesto__sentence--indent { padding-inline-start: clamp(2rem, 8vw, 6rem); }
}


/* --------------------------------------------------------------------------
   3. Servizi (la griglia editoriale è in global.css: qui solo numerazione e coda)
   -------------------------------------------------------------------------- */

.services .section__header { margin-bottom: var(--section-spacing-sm); }

.services .photo-card__meta { margin: 0 0 .75rem; }

.services__more {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-line);
}

/* Link con freccia: target touch ≥ 44px; il padding è compensato dai margini, il ritmo non cambia */
.services__more .link-arrow {
  padding-block: .7rem;
  margin-block: -.7rem;
}

.treatments .editorial-split__body > .link-arrow,
.philosophy .editorial-split__body > .link-arrow {
  padding-block: .7rem;
  margin-top: calc(var(--space-4) - .7rem);
  margin-bottom: -.7rem;
}


/* --------------------------------------------------------------------------
   4. Trattamenti
   -------------------------------------------------------------------------- */

.treatments .section__header { margin-bottom: var(--section-spacing-sm); }

.treatments__split + .treatments__split { margin-top: var(--section-spacing-sm); }

@media (min-width: 992px) {
  .treatments__split + .treatments__split { margin-top: var(--section-spacing); }

  /* Il secondo media è più contenuto e spinto a destra: due pesi diversi, stesso ritmo.
     Larghezza definita (non max-width + margin auto): un'immagine lazy non ancora caricata
     renderebbe il figure shrink-to-fit largo 0. */
  .treatments__split--corpo .editorial-split__media {
    width: min(100%, 34rem);
    justify-self: end;
  }
}


/* --------------------------------------------------------------------------
   5. Sticky story 3D
   -------------------------------------------------------------------------- */

.sticky-story {
  position: relative;
  height: 300vh;
  background-color: var(--color-ivory);
}

/* Lo stage resta sticky via CSS: ScrollTrigger non lo pinna (vedi animations.js) */
.sticky-story__stage {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100svh;
}

.sticky-story__eyebrow {
  position: absolute;
  top: calc(var(--header-height) + var(--space-4));
  inset-inline: 0;
  margin: 0;
  padding-inline: var(--gutter);
  text-align: center;
}

.sticky-story__caption {
  position: absolute;
  bottom: clamp(2rem, 6vh, 4rem);
  inset-inline: 0;
  max-width: 34ch;
  margin: 0 auto;
  padding-inline: var(--gutter);
  font-size: var(--text-small);
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-muted);
}

/* Scena Three.js: quadrata, canvas e fallback sovrapposti */
.three-scene {
  position: relative;
  width: clamp(260px, 44vmin, 560px);
  aspect-ratio: 1 / 1;
  padding: 0;
}

.three-scene__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.three-scene__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  background-color: transparent; /* il placeholder è già su avorio */
  transition: opacity var(--dur-slow) var(--ease-out);
}

.three-scene__fallback > picture,
.three-scene__fallback .media__img {
  width: 100%;
  height: 100%;
}

.three-scene.is-ready .three-scene__fallback { opacity: 0; }

.three-scene.is-fallback .three-scene__canvas { display: none; }

/* Parole giganti centrate sul blob */
.sticky-story__words {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.sticky-story__word {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 12vw, 11rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-ink);
  opacity: 0;
  will-change: opacity, transform;
}

.sticky-story__word.is-active { opacity: 1; }

@media (max-width: 768px) {
  .sticky-story { height: 220vh; }

  .three-scene { width: clamp(220px, 70vw, 420px); }

  .sticky-story__eyebrow { top: calc(var(--header-height) + var(--space-3)); }
}

/* Telefoni in orizzontale: lo stage non ha spazio verticale per header + eyebrow + blob + caption */
@media (max-height: 500px) {
  .three-scene { width: clamp(140px, 36vmin, 560px); }

  .sticky-story__eyebrow,
  .sticky-story__caption { display: none; }

  .sticky-story__word { font-size: clamp(2.5rem, 14vmin, 11rem); }
}


/* --------------------------------------------------------------------------
   6. Filosofia
   -------------------------------------------------------------------------- */

.philosophy .lead { max-width: 24ch; }

@media (min-width: 992px) {
  /* Ritratto più stretto e allineato a destra: lascia respirare il testo */
  .philosophy .editorial-split__media {
    width: min(100%, 36rem);
    justify-self: end;
  }
}


/* --------------------------------------------------------------------------
   7. Experience
   -------------------------------------------------------------------------- */

.experience {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: var(--section-spacing);
  overflow: hidden;
  text-align: center;
}

.experience__media {
  z-index: 0;
  background-color: var(--color-espresso);
}

.experience__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(27, 23, 20, .62), rgba(27, 23, 20, .28) 55%, rgba(27, 23, 20, .4));
  pointer-events: none;
}

.experience__content {
  position: relative;
  z-index: 2;
}

.experience__content .display {
  max-width: 14ch;
  margin-inline: auto;
}

.experience__content p:not(.eyebrow) {
  max-width: 42ch;
  margin: var(--space-5) auto 0;
  font-size: var(--text-lead);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(247, 243, 238, .88);
}


/* --------------------------------------------------------------------------
   8. Testimonianze
   -------------------------------------------------------------------------- */

.testimonials__stars {
  display: inline-flex;
  gap: .45rem;
  margin-bottom: var(--space-5);
  color: var(--color-champagne);
}

.testimonials__star {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Le voci si sovrappongono nella stessa cella: l'altezza resta quella della più lunga */
.testimonials__track {
  position: relative;
  display: grid;
  align-items: center;
}

.testimonials__item {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
}

.testimonials__item.is-active {
  opacity: 1;
  pointer-events: auto;
}

.testimonials__quote {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-wrap: balance;
  color: var(--color-ink);
}

.testimonials__author {
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.testimonials__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.testimonials__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text);
  background-color: transparent;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.testimonials__icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

@media (hover: hover) {
  .testimonials__btn:hover {
    color: var(--color-ivory);
    background-color: var(--color-espresso);
    border-color: var(--color-espresso);
  }
}

.testimonials__dots {
  display: flex;
  align-items: center;
}

/* Generati da animations.js: area 44px, punto da 6px */
.testimonials__dot {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.testimonials__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background-color: var(--color-muted);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.testimonials__dot[aria-current="true"]::before {
  background-color: var(--color-espresso);
  transform: scale(1.35);
}

@media (hover: hover) {
  .testimonials__dot:hover::before { background-color: var(--color-espresso); }
}


/* --------------------------------------------------------------------------
   9. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow,
  .hero .lead,
  .hero__actions > *,
  .hero__scroll,
  .hero__overlay,
  .hero__title .word { opacity: 1; }

  .hero__scroll-icon { animation: none; }

  .hero__media { will-change: auto; }

  .three-scene__fallback { transition: none; }

  /* animations.js porta tutte le parole a opacity 1: qui resta visibile solo quella attiva */
  .sticky-story__word:not(.is-active) { opacity: 0 !important; }

  .sticky-story__word { will-change: auto; }
}
