/* =========================================================
   DripItaly — pagina "La nostra app"
   Stile da presentazione di prodotto: hero con iPhone che sale,
   tour con schermate che cambiano allo scroll, bento delle funzioni.
   Usa i token di style.css.
   ========================================================= */

/* ---------- iPhone disegnato in CSS ---------- */
.phone {
  --w: 300px;
  position: relative;
  width: var(--w);
  aspect-ratio: 780 / 1691;
  padding: calc(var(--w) * 0.035);
  border-radius: calc(var(--w) * 0.17);
  background: linear-gradient(145deg, #4a4543, #1c1918 40%, #2b2725 60%, #0d0b0a);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    inset 0 0 0 calc(var(--w) * 0.012) #0b0908,
    0 50px 120px -30px rgba(112, 63, 204, 0.55),
    0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.phone::before,
.phone::after { /* tasti laterali */
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #2b2725;
}
.phone::before { left: -3px; top: 22%; height: 12%; box-shadow: 0 calc(var(--w) * 0.2) 0 #2b2725; }
.phone::after { right: -3px; top: 28%; height: 17%; }
.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.14);
  background: #121212;
  transform: translateZ(0);
}
.phone__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.012);
}

/* ---------- 1. Hero ---------- */
.ah { position: relative; height: 210vh; }
.ah__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--header-h) + clamp(24px, 5vh, 64px));
  text-align: center;
}
.ah__aurora { position: absolute; inset: 0; pointer-events: none; }
.ah__aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: auroraDrift 18s var(--ease-in-out) infinite alternate;
}
.ah__aurora i:nth-child(1) { width: 60vw; height: 60vw; left: -15vw; top: 10vh; background: var(--accent-700); }
.ah__aurora i:nth-child(2) { width: 50vw; height: 50vw; right: -10vw; top: 30vh; background: var(--accent-500); opacity: 0.35; animation-duration: 22s; }
.ah__aurora i:nth-child(3) { width: 40vw; height: 40vw; left: 30vw; bottom: -20vw; background: #3b1d7a; animation-duration: 26s; }
@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, -4vh, 0) scale(1.15); }
}

.ah__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
  transform: translateY(calc(var(--hp, 0) * -14vh));
  opacity: calc(1 - var(--hp, 0) * 1.6);
}
.ah__icon {
  width: clamp(64px, 8vw, 96px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 20px 50px -14px rgba(151, 119, 232, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  margin-bottom: var(--linear-200);
}
.ah__name {
  font-size: var(--fs-label);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent-300);
  margin: 0 0 var(--linear-150);
}
.ah__title {
  font-size: clamp(36px, 7.6vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin: 0 0 var(--linear-400);
  color: var(--white);
}
.ah__grad {
  background: linear-gradient(90deg, var(--accent-300), #e8d7ff 40%, var(--accent-400) 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s ease-in-out infinite alternate;
}
@keyframes gradShift { to { background-position: 100% 0; } }

.ah__cta { display: flex; flex-direction: column; align-items: center; gap: var(--linear-100); }
.ah__store img { height: 52px; width: auto; transition: transform 0.4s var(--ease-out); }
.ah__store:hover img { transform: scale(1.05); }
.ah__meta { font-size: var(--fs-label); letter-spacing: 1px; color: var(--layer-base-text); }

.ah__stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translateX(-50%);
}
.phone--hero {
  --w: clamp(240px, 26vw, 360px);
  position: absolute;
  left: 50%;
  top: 100%;
  /* sale da sotto la piega e si raddrizza */
  transform:
    translate(-50%, calc(-22vh - var(--hp, 0) * 68vh))
    perspective(1400px)
    rotateX(calc(28deg - var(--hp, 0) * 28deg))
    scale(calc(0.92 + var(--hp, 0) * 0.12));
  transform-origin: 50% 0;
}
.js .phone--hero { opacity: 0; animation: heroPhoneIn 1.4s var(--ease-out) 0.5s forwards; }
@keyframes heroPhoneIn { to { opacity: 1; } }

.ah__chip {
  position: absolute;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: var(--modular-2xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: calc(var(--hp, 0) * 2.2 - 0.6);
  transform: translateY(calc((1 - var(--hp, 0)) * 60px));
}
.ah__chip--1 { left: 14%; top: 48%; }
.ah__chip--2 { right: 15%; top: 40%; }
.ah__chip--3 { left: 20%; top: 72%; }
.ah__chip--4 { right: 18%; top: 66%; }
@media (max-width: 767px) {
  .ah { height: 170vh; }
  .ah__chip { display: none; }
  .phone--hero { transform: translate(-50%, calc(-18vh - var(--hp, 0) * 56vh)) perspective(1200px) rotateX(calc(24deg - var(--hp, 0) * 24deg)); }
}

/* ---------- 2. Statement ---------- */
/* in home la frase sale sopra l'hero (margin-top negativo): qui no */
.appage .statement { margin-top: 0; padding-top: var(--section-y); }

/* ---------- 3. Tour ---------- */
.tour { position: relative; height: 320vh; }
.tour__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.tour__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(32px, 8vw, 140px);
  align-items: center;
}
.tour__steps { list-style: none; margin: 0; padding: 0; display: grid; }
.tour__step {
  grid-area: 1 / 1;
  max-width: 30ch;
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out), filter 0.7s var(--ease-out);
  pointer-events: none;
}
.tour__step.is-active { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.tour__step.is-past { transform: translateY(-40px); }
.tour__num {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: var(--title-tracking);
  text-transform: uppercase;
  color: var(--accent-300);
  margin-bottom: var(--linear-200);
}
.tour__step h3 {
  font-size: clamp(32px, 5.4vw, 76px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--white);
  margin-bottom: var(--linear-300);
}
.tour__step p { font-size: clamp(var(--modular-xs), 1.3vw, var(--modular-sm)); line-height: 1.6; color: var(--layer-one-text); max-width: 38ch; }

.tour__device { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--linear-300); }
.tour__device .phone { --w: clamp(230px, 24vw, 330px); }
.tour__device::before {
  content: "";
  position: absolute;
  inset: 10% -30%;
  background: radial-gradient(closest-side, rgba(112, 63, 204, 0.45), transparent);
  filter: blur(30px);
  z-index: -1;
}
.tour__shot {
  opacity: 0;
  transform: scale(1.06) !important;
  transition: opacity 0.7s var(--ease-out), transform 1s var(--ease-out);
}
.tour__shot.is-active { opacity: 1; transform: scale(1.012) !important; }
.tour__shot--top { object-position: center top; }
.tour__dots { display: flex; gap: 8px; }
.tour__dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--browngray-700);
  transition: width 0.5s var(--ease-out), background-color 0.3s ease;
}
.tour__dots span.is-active { width: 28px; background: var(--accent-400); }

@media (max-width: 767px) {
  .tour { height: 300vh; }
  .tour__grid { grid-template-columns: 1fr; gap: var(--linear-300); justify-items: center; text-align: center; }
  .tour__device { order: -1; }
  .tour__device .phone { --w: min(56vw, 34vh); }
  .tour__step { max-width: none; }
  .tour__step h3 { font-size: clamp(26px, 8vw, 40px); margin-bottom: var(--linear-150); }
  .tour__step h3 br { display: none; }
  .tour__step p { margin: 0 auto; font-size: var(--modular-2xs); }
  .tour__num { margin-bottom: var(--linear-100); }
}

/* ---------- 4. Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(260px, auto);
  gap: var(--linear-200);
}
.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(24px, 3vw, 40px);
  background: linear-gradient(160deg, var(--browngray-900), #1d1918);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: opacity 1s var(--ease-out) var(--d, 0s), filter 1s var(--ease-out) var(--d, 0s), transform 0.5s var(--ease-out), border-color 0.3s ease;
}
.tile.reveal:not(.is-visible) { transform: translateY(40px); }
.tile.reveal.is-visible { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.tile:hover { border-color: rgba(178, 143, 250, 0.35); }
.tile::after { /* riflesso che segue il cursore */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(178, 143, 250, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tile:hover::after { opacity: 1; }
.tile h3 { font-size: clamp(20px, 2.1vw, 30px); line-height: 1.1; letter-spacing: -0.03em; color: var(--white); margin: 0; }
.tile p { margin: var(--linear-150) 0 0; font-size: var(--modular-2xs); color: var(--layer-base-text); }
.tile__kicker {
  font-size: var(--modular-3xs);
  letter-spacing: var(--title-tracking);
  text-transform: uppercase;
  color: var(--accent-300);
  margin-bottom: var(--linear-150);
}

.tile--map { grid-column: span 4; grid-row: span 2; justify-content: flex-start; padding-bottom: 0; background: linear-gradient(170deg, #2a1656, #160c2e); }
.tile__map {
  position: relative;
  margin: var(--linear-400) calc(clamp(24px, 3vw, 40px) * -1) 0;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%);
  mask-image: linear-gradient(to bottom, transparent, #000 18%);
}
.tile__map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; opacity: 0.85; transition: transform 6s var(--ease-out); }
.tile--map:hover .tile__map img { transform: scale(1.08); }
.pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 3px #fff;
}
.pin::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #34c759;
  animation: ping 2.4s var(--ease-out) var(--d) infinite;
}
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(4); opacity: 0; } }

.tile--open { grid-column: span 2; }
.open-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: auto 0 var(--linear-300);
  padding: 12px 22px;
  border-radius: var(--radius-full);
  background: #1f9d55;
  color: var(--white);
  font-size: var(--modular-xs);
  box-shadow: 0 12px 40px -10px rgba(52, 199, 89, 0.7);
  animation: pillPulse 3s ease-in-out infinite;
}
.open-pill__check { font-weight: 700; }
@keyframes pillPulse { 50% { transform: scale(1.05); } }

.tile--tailor { grid-column: span 2; }
.tile__big {
  font-size: clamp(64px, 8vw, 110px);
  line-height: 1;
  margin: auto 0 var(--linear-200);
  color: var(--accent-300);
  transform: rotate(-20deg);
  transition: transform 0.8s var(--ease-out);
  display: inline-block;
  align-self: flex-start;
}
.tile--tailor:hover .tile__big { transform: rotate(10deg) scale(1.1); }

.tile--cats { grid-column: span 2; }
.cats { list-style: none; margin: auto 0 var(--linear-300); padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cats li {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: #d9d9d9;
  color: #1b1b1b;
  font-size: var(--modular-2xs);
  transition: transform 0.4s var(--ease-out), background-color 0.3s ease, color 0.3s ease;
}
.cats li:hover { transform: translateY(-3px); background: var(--accent-400); color: var(--white); }

.tile--flag { grid-column: span 2; background: linear-gradient(160deg, var(--accent-700), var(--accent-900)); }
.flag-btn {
  align-self: flex-start;
  margin: auto 0 var(--linear-300);
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--accent-400);
  color: var(--white);
  box-shadow: 0 14px 40px -10px var(--accent-400);
  transition: transform 0.5s var(--ease-out);
}
.tile--flag:hover .flag-btn { transform: translateY(-6px) rotate(-8deg); }
.tile--flag p { color: var(--accent-100); }

.tile--free { grid-column: span 2; text-align: left; }
.tile__huge {
  margin: auto 0 var(--linear-100) !important;
  font-size: clamp(72px, 9vw, 140px) !important;
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: transparent !important;
  background: linear-gradient(180deg, var(--white), var(--accent-400));
  -webkit-background-clip: text;
  background-clip: text;
}

@media (max-width: 991px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile--map { grid-column: span 2; grid-row: span 1; }
  .tile--open, .tile--tailor, .tile--cats, .tile--flag, .tile--free { grid-column: span 1; }
}
@media (max-width: 599px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: minmax(220px, auto); }
  .tile--map, .tile--open, .tile--tailor, .tile--cats, .tile--flag, .tile--free { grid-column: span 1; }
}

/* ---------- 5. Rise: telefono grande che emerge ---------- */
.rise {
  position: relative;
  padding-top: var(--section-y);
  overflow: hidden;
  text-align: center;
  background: radial-gradient(80% 60% at 50% 100%, rgba(112, 63, 204, 0.35), transparent 70%);
}
.rise__copy { max-width: 820px; }
.rise__copy h2 { font-size: clamp(32px, 6vw, 88px); line-height: 1; letter-spacing: -0.05em; color: var(--white); }
.rise__copy .lead { max-width: 52ch; margin: 0 auto; }
.rise__stage {
  position: relative;
  height: clamp(380px, 62vw, 720px);
  margin-top: var(--linear-800);
}
.phone--rise {
  --w: clamp(280px, 34vw, 460px);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, calc((1 - var(--p, 0)) * 35%)) scale(calc(0.9 + var(--p, 0) * 0.1));
}
.phone--rise .phone__screen img { object-position: center top; }

/* ---------- 6. In arrivo ---------- */
.next__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--linear-200); }
.next__card {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--browngray-100);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.next__card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(88, 46, 163, 0.35); }
.next__card h3 { font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.03em; color: var(--browngray-950); margin: var(--linear-300) 0 var(--linear-150); }
.next__card p { margin: 0; color: var(--browngray-600); }
.next__tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: var(--modular-3xs);
  letter-spacing: var(--title-tracking);
  text-transform: uppercase;
}
@media (max-width: 991px) { .next__grid { grid-template-columns: 1fr; } }

/* ---------- 7. Scheda tecnica ---------- */
.specs { padding: var(--section-y) 0 calc(var(--section-y) * 0.5); }
.specs__title {
  font-size: var(--fs-label);
  letter-spacing: var(--title-tracking);
  text-transform: uppercase;
  color: var(--layer-base-text);
  padding-bottom: var(--linear-300);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0;
}
.specs__grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.specs__grid > div { padding: var(--linear-400) var(--linear-300) var(--linear-400) 0; border-bottom: 1px solid var(--divider); }
.specs dt { font-size: var(--modular-3xs); letter-spacing: var(--title-tracking); text-transform: uppercase; color: var(--layer-base-text); margin-bottom: var(--linear-100); }
.specs dd { margin: 0; font-size: clamp(18px, 2vw, 26px); letter-spacing: -0.02em; color: var(--heading-text); }
@media (max-width: 767px) { .specs__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- 8. CTA ---------- */
.appcta { position: relative; overflow: hidden; }
.appcta__halo {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-700), var(--accent-400), #3b1d7a, var(--accent-600), var(--accent-700));
  filter: blur(120px);
  opacity: 0.35;
  animation: haloSpin 20s linear infinite;
  pointer-events: none;
}
@keyframes haloSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.appcta .container { position: relative; }
.appcta__icon {
  width: 120px;
  height: auto;
  margin: 0 auto var(--linear-400);
  border-radius: 26%;
  box-shadow: 0 30px 80px -20px rgba(151, 119, 232, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.appcta__badges { justify-content: center; }
.appcta__badges img { height: 52px; }

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  .ah, .tour { height: auto; }
  .ah__sticky { position: relative; height: auto; min-height: 0; padding-bottom: var(--section-y); }
  .ah__stage { position: relative; height: auto; transform: none; left: auto; display: flex; justify-content: center; margin-top: var(--linear-500); }
  .phone--hero { position: relative; left: auto; top: auto; transform: none; opacity: 1; }
  .ah__chip { display: none; }
  .ah__copy { transform: none; opacity: 1; }
  .tour__sticky { position: relative; height: auto; padding: var(--section-y) 0; }
  .tour__steps { gap: var(--linear-500); }
  .tour__step { grid-area: auto; opacity: 1; transform: none; filter: none; }
  .phone--rise { transform: translateX(-50%); }
}
