/* iPhone geometry adapted from Devices.css by Yan Zhu (MIT).
   See /static/licenses/devices-css.txt. The native 375:812 screen ratio is
   preserved; em dimensions scale the entire hardware, including its radius. */
.iphone-mockup {
  container-type: inline-size;
  width: min(100%, 280px);
  min-width: 0;
  margin: 0 auto;
  line-height: 0;
}

.iphone-hardware {
  position: relative;
  width: 100%;
  padding: 19em;
  border-radius: 68em;
  background: #010101;
  box-shadow: inset 0 0 4em 2em #fff, inset 0 0 0 6em #d3d4d5;
  font-size: calc(100cqw / 428);
  line-height: 0;
  isolation: isolate;
}

.iphone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 812;
  overflow: hidden;
  border-radius: 49em;
  background: #faf9ff;
}

.iphone-screen img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
}

.iphone-island {
  position: absolute;
  z-index: 2;
  top: 29em;
  left: 50%;
  width: 120em;
  height: 35em;
  margin-left: -60em;
  border-radius: 20em;
  background: #010101;
}

.iphone-camera {
  position: absolute;
  z-index: 3;
  top: 42em;
  left: 50%;
  width: 9em;
  height: 9em;
  margin-left: 36em;
  border-radius: 50%;
  background: radial-gradient(farthest-corner at 20% 20%, #6074bf, transparent 40%),
              radial-gradient(farthest-corner at 80% 80%, #513785, #24555e 20%, transparent 50%);
  box-shadow: 0 0 1em 1em #ffffff0d;
}

.iphone-buttons,
.iphone-buttons::before,
.iphone-buttons::after,
.iphone-power {
  position: absolute;
  width: 3em;
  border-radius: 2em;
  background: #a7a8a9;
}

.iphone-buttons { top: 115em; left: -2em; height: 32em; }
.iphone-buttons::before,
.iphone-buttons::after { content: ""; left: 0; height: 62em; }
.iphone-buttons::before { top: 60em; }
.iphone-buttons::after { top: 140em; }
.iphone-power { top: 200em; right: -2em; height: 100em; }
.iphone-antenna::before,
.iphone-antenna::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  z-index: 4;
  left: 0;
  width: 100%;
  height: 7em;
  border-inline: 7em solid #01010140;
}
.iphone-antenna::before { top: 85em; }
.iphone-antenna::after { bottom: 85em; }

/* Keep the complete illustration in normal flow inside the sticky rail.
   The grid, rather than a scroll transform, defines its bottom boundary. */
.guide-story { isolation: isolate; }
.guide-rail {
  top: 124px;
  height: auto;
  padding: 12px 20px 28px;
  pointer-events: none;
}
.guide-mascot {
  position: relative;
  top: auto;
  left: auto;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  transform: none;
  will-change: auto;
}
.guide-shadow {
  top: auto;
  bottom: 18px;
  left: 14%;
  right: 14%;
  width: auto;
  height: 32px;
  will-change: auto;
}

/* Quiet, aligned product panels replace the oversized floating devices. */
.app-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 32px;
  padding-top: 32px;
}
.app-showcase__item { min-width: 0; }
.app-showcase__visual {
  display: grid;
  place-items: center;
  padding: 40px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
}
.app-showcase__visual--matching { background: #eeebfb; }
.app-showcase__visual--map { background: #eaf1ef; }
.app-showcase__visual--messages { background: #f0edf5; }
.app-showcase__visual--chat { background: #f3eee8; }
.app-showcase__description {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px 14px;
  padding: 28px 8px 0;
}
.app-showcase__number {
  padding-top: 7px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.app-showcase h2 {
  margin: 0;
  font: 600 clamp(32px, 3vw, 42px)/1.08 Newsreader, serif;
  letter-spacing: -.035em;
}
.app-showcase__description p {
  grid-column: 2;
  margin: 0;
  color: var(--secondary);
  line-height: 1.6;
}
.app-showcase__note {
  grid-column: 1 / -1;
  max-width: 740px;
  margin: -24px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}
.app-preview__devices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
  padding: 36px 28px;
  border: 1px solid var(--lavender);
  border-radius: 28px;
  background: #eeebfb;
}
.app-preview__devices .iphone-mockup--messages { margin-top: 56px; }

@media (max-width: 980px) {
  .guide-rail { padding-inline: 16px; }
  .guide-mascot { width: 190px; }
  .app-showcase { gap: 48px 24px; }
  .app-showcase__visual { padding: 28px 20px; }
  .app-showcase__description { grid-template-columns: 25px minmax(0, 1fr); gap: 12px 10px; padding-inline: 0; }
  .app-preview__devices { width: min(100%, 650px); margin: 14px auto 0; }
}

@media (max-width: 640px) {
  .app-showcase { grid-template-columns: 1fr; gap: 40px; padding-top: 12px; }
  .app-showcase__visual { padding: 28px 22px; border-radius: 22px; }
  .app-showcase .iphone-mockup { width: min(100%, 240px); }
  .app-showcase__description { padding-top: 22px; }
  .app-showcase h2 { font-size: 32px; }
  .app-showcase__description p { font-size: 14px; }
  .app-showcase__note { margin-top: 0; font-size: 12px; text-align: left; }
  .app-preview__devices { gap: 14px; padding: 24px 16px; border-radius: 22px; }
  .app-preview__devices .iphone-mockup--messages { margin-top: 28px; }
}

@media (max-height: 560px) and (min-width: 641px) {
  .guide-rail { position: relative; top: auto; }
}
