/* Company memory — connected context row */

.aln-system-graphic.aln-company-memory-graphic {
  overflow: hidden;
  min-height: 360px;
  height: 100%;
}

.aln-product-visual-example:has(.aln-company-memory-graphic) {
  overflow: hidden;
}

.aln-company-memory-graphic {
  --mem-ink: #101214;
  --mem-line: rgba(17, 19, 21, 0.08);
  --mem-soft: #f7f8f9;
  --mem-accent: #5f6873;
  display: grid;
  place-items: center;
  min-height: 360px;
  height: 100%;
  padding: 24px;
  border-color: rgba(0, 0, 0, 0.06);
  background:
    radial-gradient(circle at 50% 42%, rgba(15, 23, 42, 0.055), transparent 34%),
    linear-gradient(118deg, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0.78) 48%, rgba(255, 255, 255, 0) 72%),
    var(--mem-soft);
  font-family: var(--aln-font-sans);
  color: var(--mem-ink);
}

.aln-memory-stack-stage {
  position: relative;
  display: flex;
  width: min(100%, 300px);
  height: auto;
  min-height: 340px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  perspective: 820px;
  perspective-origin: 50% 38%;
  isolation: isolate;
  transform: rotateX(49deg) rotateZ(-12deg) scale(1.08);
  transform-style: preserve-3d;
}

.aln-memory-stack-stage::before {
  content: "";
  position: absolute;
  top: 4%;
  bottom: 4%;
  left: 50%;
  z-index: 0;
  width: 1px;
  height: auto;
  border: 0;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.08), transparent);
  box-shadow: none;
  opacity: 0.36;
  transform: translateX(-50%) translateZ(-8px);
  transform-origin: center;
  -webkit-mask-image: none;
  mask-image: none;
}

.aln-memory-stack-card {
  --memory-x: 0px;
  --memory-y: 0px;
  --memory-z: 0px;
  --memory-rotate: -12deg;
  --memory-tilt: 49deg;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 168px;
  min-height: 46px;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.72);
  color: #68717b;
  opacity: 0.42;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 4px 10px rgba(15, 23, 42, 0.018);
  transform: translateZ(-16px) scale(0.96);
  transform-style: preserve-3d;
  transform-origin: center;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.aln-memory-stack-card::after {
  content: "";
  position: absolute;
  inset: auto 12px -10px;
  height: 10px;
  z-index: -1;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.035);
  filter: blur(8px);
  opacity: 0.42;
  transform: translateZ(-8px);
}

.aln-memory-stack-card:nth-child(2),
.aln-memory-stack-card:nth-child(4) {
  z-index: 2;
  opacity: 0.62;
  transform: translateZ(-6px) scale(0.98);
}

.aln-memory-stack-card:nth-child(1),
.aln-memory-stack-card:nth-child(6) {
  opacity: 0.24;
  transform: translateZ(-28px) scale(0.92);
}

.aln-memory-stack-card:nth-child(5) {
  opacity: 0.34;
  transform: translateZ(-22px) scale(0.94);
}

.aln-memory-stack-card:nth-child(3) {
  z-index: 4;
  width: 196px;
  background: #ffffff;
  color: #101214;
  opacity: 1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96) inset,
    0 14px 28px rgba(15, 23, 42, 0.07),
    0 3px 8px rgba(15, 23, 42, 0.04);
  transform: translateZ(34px) scale(1.04);
}

.aln-memory-stack-card:nth-child(3)::after {
  inset: auto 14px -14px;
  height: 14px;
  background: rgba(15, 23, 42, 0.075);
  filter: blur(10px);
  opacity: 0.55;
}

.aln-memory-stack-card svg {
  display: block;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  box-sizing: content-box;
  stroke-width: 1.7;
}

.aln-memory-stack-card span {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: currentColor;
  font-family: var(--aln-font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: left;
  text-transform: none;
}

@media (max-width: 720px) {
  .aln-company-memory-graphic {
    padding: 18px;
  }

  .aln-memory-stack-stage {
    width: min(100%, 260px);
    min-height: 310px;
    flex-wrap: nowrap;
    align-content: center;
  }

  .aln-memory-stack-card {
    width: 158px;
    min-height: 44px;
    flex-basis: auto;
    gap: 8px;
    padding: 8px 11px;
  }

  .aln-memory-stack-card:nth-child(3) {
    width: 178px;
    transform: translateZ(26px) scale(1.035);
  }

  .aln-memory-stack-card svg {
    width: 18px;
    height: 18px;
    padding: 5px;
  }

  .aln-memory-stack-card span {
    font-size: 11px;
    text-align: left;
  }
}
