/**
 * Overview & Purpose
 * Styles the phone-install guide, preview screens, and geometric animations.
 *
 * Architectural Relationships
 * Called by: download-app.html.
 * Calls: Design tokens from style.css.
 *
 * External Resources
 * Local SVG preview assets.
 */

main:has(> .download-hero) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

.download-hero {
  display: grid;
  grid-column: 1 / -1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.72fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: 0.25rem 0 0.8rem;
}

.download-hero h1 {
  max-width: 24ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.install-status {
  min-height: 1rem;
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.phone-stage {
  position: relative;
  display: grid;
  min-height: 9.5rem;
  max-width: 100%;
  place-items: center;
  overflow: hidden;
}

.phone-frame {
  position: relative;
  z-index: 2;
  width: min(6rem, 38vw);
  padding: 0.4rem;
  background: var(--navy);
  border: 1px solid var(--ink);
  box-shadow: 1rem 1rem 0 rgb(123 33 26 / 16%);
  clip-path: none;
  animation: phone-float 5s ease-in-out infinite;
}

.phone-frame img {
  display: block;
  width: 100%;
  background: #fff;
}

.geometry-orbit {
  position: absolute;
  border: 1px solid rgb(23 22 19 / 24%);
  transform: rotate(45deg);
  animation: orbit-turn 16s linear infinite;
}

.geometry-orbit-one {
  width: 8rem;
  height: 8rem;
}

.geometry-orbit-two {
  width: 10rem;
  height: 10rem;
  border-color: rgb(123 33 26 / 20%);
  animation-direction: reverse;
  animation-duration: 22s;
}

.app-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.app-screenshot-grid figure {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.65rem;
  background: rgb(255 255 255 / 84%);
  border: 1px solid var(--border);
  clip-path: none;
}

.app-screenshot-grid img {
  display: block;
  width: 100%;
  max-height: 5.5rem;
  object-fit: contain;
}

.app-screenshot-grid figcaption {
  display: grid;
  gap: 0.25rem;
}

.app-screenshot-grid strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.app-screenshot-grid span,
.motion-section p,
.install-grid p {
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.35;
}

.motion-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(20rem, 1.2fr);
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0.75rem;
  color: #fff;
  background: var(--navy);
  clip-path: none;
  box-shadow: 8px 8px 0 rgb(123 33 26 / 20%);
}

.motion-section h2,
.install-guide h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 500;
}

.motion-section p {
  display: none;
}

.geometry-animation {
  display: grid;
  min-height: 4.5rem;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
}

.motion-node {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 38%);
  background: rgb(255 255 255 / 8%);
  transform: rotate(45deg);
  animation: node-pulse 3.6s ease-in-out infinite;
}

.motion-node i {
  display: inline-block;
  font-style: normal;
  transform: rotate(-45deg);
}

.motion-node-b {
  animation-delay: 1.2s;
}

.motion-node-c {
  animation-delay: 2.4s;
}

.motion-line {
  height: 1px;
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold), #fff);
  animation: line-travel 2.4s ease-in-out infinite;
}

.motion-line-b {
  animation-delay: 1.2s;
}

.install-guide {
  padding: 0;
}

main:has(> .download-hero) > .section-block {
  grid-column: 1 / -1;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.5rem 0;
}

.install-grid article {
  min-height: 0;
  padding: 0.45rem;
  background: rgb(255 255 255 / 84%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--teal);
}

.install-grid article > span {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
}

.install-grid h3 {
  margin: 0.5rem 0 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.install-again {
  display: none;
}

.install-grid p {
  font-size: 0.65rem;
  line-height: 1.25;
}

@keyframes phone-float {
  0%, 100% { transform: translateY(-0.35rem); }
  50% { transform: translateY(0.7rem); }
}

@keyframes orbit-turn {
  to { transform: rotate(405deg); }
}

@keyframes node-pulse {
  0%, 22%, 100% { border-color: rgb(255 255 255 / 30%); background: rgb(255 255 255 / 8%); }
  35%, 55% { border-color: var(--gold); background: rgb(184 128 36 / 22%); }
}

@keyframes line-travel {
  0%, 20% { transform: scaleX(0); opacity: 0; }
  50%, 80% { transform: scaleX(1); opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 700px) {
  main:has(> .download-hero) {
    display: block;
  }

  .download-hero,
  .motion-section,
  .app-screenshot-grid {
    grid-template-columns: 1fr;
  }

  .download-hero {
    padding-top: 0.25rem;
  }

  .phone-stage {
    min-height: 15rem;
  }

  .app-screenshot-grid figure {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .install-grid {
    grid-template-columns: 1fr;
  }

  .install-grid article {
    min-height: auto;
  }

  .install-grid h3 {
    margin-top: 0.5rem;
  }
}

@media (max-width: 560px) {
  .download-hero h1 {
    font-size: 1.65rem;
  }

  .geometry-orbit-one {
    width: 10rem;
    height: 10rem;
  }

  .geometry-orbit-two {
    width: 13rem;
    height: 13rem;
  }

  .phone-stage {
    min-height: 9.5rem;
  }

  .phone-frame {
    width: min(6rem, 34vw);
  }

  .app-screenshot-grid figure {
    grid-template-columns: 1fr;
  }

  .app-screenshot-grid img {
    max-height: 5.5rem;
  }

  .geometry-animation {
    min-height: 6rem;
  }

  .motion-node {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-frame,
  .geometry-orbit,
  .motion-node,
  .motion-line {
    animation: none;
  }
}
