/* ============================================
   home.css — Homepage guide.coseinutili.it
   ============================================ */

/* ============================================
   RIBBON SCENE — sezione scrollabile principale
   ============================================ */
.ribbon-scene {
  position: relative;
  min-height: 350vh;
  overflow: hidden;
}

/* --- SVG ribbon: posizionato in alto a destra ---
   Stesso comportamento dell'originale 21st.dev:
   il SVG è absolute, leggermente fuori schermo a destra,
   con overflow visible il groviglio rimane visibile */
.ribbon-svg-wrapper {
  position: absolute;
  top: 0;
  right: 8%;
  left: auto;
  transform: none;
  width: 78%;
  pointer-events: none;
  z-index: 1;
}
.ribbon-svg-wrapper svg {
  width: 100%;
  height: auto;
  overflow: visible;
  opacity: 1;
}

/* Gradiente animato — stesso stile di le-basi.html */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    135deg,
    #deeaa0 0%,
    #F5EDE3 25%,
    #f5dde5 50%,
    #cfe396 75%,
    #F5EDE3 100%
  );
  background-size: 400% 400%;
  animation: homeGradShift 12s ease infinite;
}

@keyframes homeGradShift {
  0%   { background-position: 0%   50%; }
  25%  { background-position: 50%  0%;  }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 50%  100%;}
  100% { background-position: 0%   50%; }
}

/* --- HERO --- */
.hero {
  position: relative;
  z-index: 10;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100dvh - 120px); /* 2 × altezza header (60px) per centrare nel viewport visibile */
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;   /* centrato */
  gap: 0;
  pointer-events: none;
  text-align: center;
}

/* Righe display — identico alla basi-hero__title */
.hero__line-regular,
.hero__line-mixed,
.hero__line-logo,
.hero__regular-text {
  margin: 0;
  display: block;
  text-align: center;
  line-height: 1.05;
}

/* Titolo hero — Raleway 800 */
.hero__regular-text,
.hero__line-regular {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  color: var(--color-ink);
  letter-spacing: -0.03em;
}

/* Riga accent Caveat (non più usata nel titolo, mantenuta per compatibilità) */
.hero__line-mixed {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(4.5rem, 11vw, 10rem);
  color: var(--color-green);
  font-style: italic;
}

/* Sottotitolo hero — Kalam verde */
.hero__line-sub {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  color: var(--color-green);
  line-height: 1.3;
  max-width: 680px;
  width: 90%;
  margin-top: 0.75rem;
}

/* parola accent — Caveat, stesso stile di le-basi.html */
.hero__accent {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(3.6rem, 9.5vw, 8.2rem);
  color: var(--color-green);
  line-height: 1.0;
  font-style: italic;
}

/* Riga logo: "su" + immagine — logo allineato in basso con il testo */
.hero__line-logo {
  align-items: flex-end;
  gap: 0.5em;
  margin-top: 0.1em;
}
.hero__logo-img {
  height: clamp(3.5rem, 9.5vw, 8rem);
  width: auto;
  display: block;
  mix-blend-mode: multiply;
  transform: translateY(1.3em);
}

/* ============================================
   JOURNEY STEPS — card che appaiono scorrendo
   ============================================ */
.journey-steps {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.hero-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  padding: 0 2rem;
  text-align: center;
}

.hero-bridge--b2 {
  flex-direction: column;
  gap: 2rem;
  margin-top: 15vh;
}

/* Bridge 1 — due righe, due font */
.bridge-1__text {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 1.1;
  opacity: 0;
  transform: translateY(32px);
}
.bridge-1__line-a {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: -0.03em;
}
.bridge-1__line-b {
  display: block;
  font-family: 'Kalam', cursive;
  font-weight: 700;
  color: var(--color-fuchsia);
}

/* Bridge 2 — tutto Raleway */
.bridge-2__text {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  color: var(--color-ink-soft);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 760px;
  opacity: 0;
  transform: translateY(32px);
}

/* Freccia animata */
.bridge-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
}
.bridge-arrow__line {
  width: 1.5px;
  height: 60px;
  background: var(--color-ink-mute);
  transform: scaleY(0);
  transform-origin: top center;
}
.bridge-arrow__tip {
  font-size: 1.1rem;
  color: var(--color-ink-mute);
  margin-top: -4px;
  opacity: 0;
}
@keyframes arrowGrow {
  to { transform: scaleY(1); }
}
@keyframes arrowFade {
  to { opacity: 1; }
}

.journey-step {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity  0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.journey-step.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Posizione alternata sinistra/destra */
#step-basi    { justify-content: flex-start; padding-left: 6%; }
#step-academy { justify-content: flex-end; padding-right: 6%; align-items: flex-start; padding-top: 3vh; }

/* Step pair — illustrazione + testo affiancati */
.step-pair {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.step-pair--reverse {
  flex-direction: row-reverse;
}
.step-pair__text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.step-pair__eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-mute);
  margin: 0;
}
.step-pair__link {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  color: var(--color-green-dark);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.15;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}
.step-pair__link:hover {
  color: var(--color-green);
  transform: translateX(4px);
}
.step-pair__link--fuchsia {
  color: var(--color-fuchsia-dark);
}
.step-pair__link--fuchsia:hover {
  color: var(--color-fuchsia);
  transform: translateX(4px);
}

/* Card */
.journey-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
  max-width: 440px;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 28px rgba(0,0,0,0.09);
  transition: box-shadow 0.3s, transform 0.3s;
}
.journey-card:hover {
  box-shadow: 0 8px 36px rgba(0,0,0,0.14);
  transform: translateY(-3px);
}
.journey-card__icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.15rem;
}
.journey-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.journey-card__body h2 {
  font-size: 1.4rem;
  line-height: 1.2;
  margin-top: 0.1rem;
}
.journey-card__body p {
  color: var(--color-ink-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Illustrazione basi */
.basi-illustration {
  width: min(380px, 55vw);
  height: auto;
  display: block;
}

/* --- Finale --- */
.journey-step--finale {
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.finale-text {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}

.finale-brand {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 0.2s;
}

.finale-brand:hover {
  color: var(--color-green-dark);
}

.finale-brand__in {
  color: var(--color-green);
}

/* ============================================
   CONCEPTS CAROUSEL — scroll-driven horizontal fan
   ============================================ */
.concepts-section {
  position: relative;
  height: 450vh;
  background: var(--color-bg);
}

.concepts-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(150,175,0,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(226,56,84,0.05) 0%, transparent 45%);
}

.concepts-header {
  flex: 0 0 auto;
  text-align: center;
  padding: 6vh 1.5rem 0;
  position: relative;
  z-index: 3;
}

.concepts-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-green);
  margin-bottom: 0.75rem;
}

.concepts-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  margin: 0;
}

/* Track */
.concepts-track-wrapper {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.concepts-track {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-left: calc(50vw - 170px);
  padding-right: calc(50vw - 170px);
  will-change: transform;
}

/* Slide wrapper — holds the inner animated div */
.concept-slide {
  flex: 0 0 340px;
}

.concept-card-inner {
  will-change: transform, opacity;
  transform-origin: center center;
  transition: none; /* JS drives this */
}

/* Card */
.concept-card {
  width: min(340px, 88vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(42,42,42,0.10), 0 2px 20px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
}

/* Card cover — colored top strip */
.concept-card__cover {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.concept-card__cover--green,
.concept-card__cover--amber,
.concept-card__cover--fuchsia,
.concept-card__cover--teal,
.concept-card__cover--coral,
.concept-card__cover--purple { background: #FDF4E8; }

.concept-card__emoji {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.concept-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 1.25rem 1.5rem;
  display: block;
  mix-blend-mode: multiply;
}

/* Card body */
.concept-card__body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.concept-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.concept-card__tag {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.concept-tag--green  { color: var(--color-green-dark); }
.concept-tag--amber  { color: #92400E; }
.concept-tag--fuchsia { color: var(--color-fuchsia-dark); }
.concept-tag--teal   { color: #065F46; }
.concept-tag--coral  { color: #9A3412; }
.concept-tag--purple { color: #5B21B6; }

.concept-card__num {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
}
.concept-num--green  { color: var(--color-green); }
.concept-num--amber  { color: #D97706; }
.concept-num--fuchsia { color: var(--color-fuchsia); }
.concept-num--teal   { color: #059669; }
.concept-num--coral  { color: #EA580C; }
.concept-num--purple { color: #7C3AED; }

.concept-card__title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin: 4px 0 8px;
}

.concept-card__body p {
  font-family: var(--font-body);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--color-ink-soft);
  margin: 0 0 14px;
  flex: 1;
}

.concept-card__link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-green);
  text-decoration: none;
  transition: color 0.2s;
  align-self: flex-start;
}
.concept-card__link:hover { color: var(--color-green-dark); }

/* Scroll hint */
.concepts-hint {
  flex: 0 0 auto;
  text-align: center;
  padding-bottom: 16px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--color-ink-mute);
  position: relative;
  z-index: 3;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .hero { min-height: 100dvh; }

  .ribbon-svg-wrapper {
    top: 0;
    right: 5%;
    left: auto;
    width: 1278px;
  }
  .ribbon-svg-wrapper svg {
    width: 1278px;
    height: auto;
  }
}

@media (max-width: 768px) {
  .hero { padding-bottom: 18vh; }

  /* display: block evita che flex spezzi "cose", "(in)", "utili" su righe separate */
  .hero__line-regular,
  .hero__regular-text {
    display: block;
    text-align: center;
    font-size: 11vw;
  }
  .hero__line-mixed {
    display: block;
    text-align: center;
    font-size: 12.5vw;
  }

  .ribbon-svg-wrapper {
    top: 0;
    right: -40%;
    left: auto;
    width: 1278px;
  }
  .ribbon-svg-wrapper svg {
    width: 1278px;
    height: auto;
  }

  .journey-card {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
  }
  #step-basi,
  #step-academy {
    justify-content: center;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Su mobile: testo sopra all'illustrazione */
  #step-basi .step-pair {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  /* Academy: DOM ha prima il testo, poi l'immagine (step-pair--reverse) → column basta */
  #step-academy .step-pair {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .finale-text { font-size: clamp(2.8rem, 14vw, 5rem); }
}
