/* ============================================================
   Section 01 — Memory (R6).

   Apoc-set headline + Inter body on the left, three in-app-styled
   memory cards stacked + cascaded on the right. After the third card
   lands, a single Casel-Red sonar ring fires from the top card's
   right edge. No waveform, no Alex card, no typewriter — those moved
   to the Ask Alex pill.
   ============================================================ */

.section-what {
  padding-top: clamp(6rem, 12vw + 1rem, 10rem);
  padding-bottom: var(--section-py);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* v8 — pilgrimage figure walking toward distant amber light. Activates
   "Alex non ti chiede due volte chi sei" — the page tells you Alex is
   walking with you, not just talking. Low opacity so cards stay dominant. */
.section-what::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../../assets/img/section-01-pilgrimage.jpg');
  background-size: cover;
  background-position: 80% 50%;
  opacity: 0.42;
  pointer-events: none;
}
.section-what::after {
  /* darken left where copy lives, leave right where the image speaks */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(10, 12, 24, 0.92) 0%,
    rgba(10, 12, 24, 0.78) 35%,
    rgba(10, 12, 24, 0.38) 60%,
    rgba(10, 12, 24, 0.16) 90%
  );
  pointer-events: none;
}
.section-what > * { position: relative; z-index: 2; }

@media (max-width: 900px) {
  .section-what::before {
    background-position: 50% 75%;
    opacity: 0.32;
  }
  .section-what::after {
    background: linear-gradient(
      180deg,
      rgba(10, 12, 24, 0.92) 0%,
      rgba(10, 12, 24, 0.58) 35%,
      rgba(10, 12, 24, 0.28) 65%,
      rgba(10, 12, 24, 0.45) 100%
    );
  }
}

.section-what__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .section-what__inner {
    grid-template-columns: 1.1fr 1fr;
  }
}

.section-what__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 100%;
}
.section-what__copy .ap-headline {
  max-width: 14ch;
}
.section-what__copy .ap-micro {
  align-self: flex-start;
}

.section-what__body {
  max-width: 40ch;
  margin: 0;
}

/* ---------- Memory cards stack ---------- */

.memory-cards {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 340px;
  margin-inline-start: 0;
}

@media (min-width: 900px) {
  .memory-cards {
    margin-inline-start: auto;
  }
}

.memory-card {
  position: relative;
  background: var(--color-blue-steel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--font-sans);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 30px -16px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(12px);
}
.memory-card + .memory-card {
  margin-inline-start: 16px;
}
.memory-card + .memory-card + .memory-card {
  margin-inline-start: 32px;
}

@media (prefers-reduced-motion: no-preference) {
  .memory-card.is-landed {
    animation: memory-card-rise 360ms var(--ease-out) forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .memory-card {
    opacity: 1;
    transform: none;
  }
}
@keyframes memory-card-rise {
  to { opacity: 1; transform: none; }
}

.memory-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.memory-card__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-red);
}
.memory-card__date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-muted-soft);
  font-variant-numeric: tabular-nums;
}
.memory-card__body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-fg);
  font-weight: 400;
}

/* ---------- Sonar ring from top card's right edge ---------- */

.memory-card--first {
  /* allow the sonar ring to escape the right edge without being clipped */
  overflow: visible;
}
.memory-card--first::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--color-red);
  transform: translate(0, -50%) scale(1);
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .memory-card--first.is-sonar::after {
    animation: memory-sonar 900ms var(--ease-out) forwards;
  }
}
@keyframes memory-sonar {
  0% { opacity: 0.8; transform: translate(0, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(0, -50%) scale(4.5); }
}
@media (prefers-reduced-motion: reduce) {
  /* static glow on the top card's edge in lieu of the sonar */
  .memory-card--first::after {
    opacity: 0.5;
    transform: translate(0, -50%) scale(1);
  }
}
