/* Custom Orders page: The Hunt showcase with 3D phone mockups. Colors come from theme.css only. */

.co-hero { text-align: center; }
.co-hero .lead { margin-left: auto; margin-right: auto; }

.hunt-intro { text-align: center; margin-top: 36px; }
.hunt-intro h2 { font-size: clamp(34px, 6vw, 56px); margin: 0 0 8px; }
.hunt-intro .tagline { font-size: 20px; color: var(--accent-hover); font-weight: 700; max-width: 680px; margin: 0 auto 12px; }
.hunt-intro .muted { max-width: 680px; margin: 0 auto; }
.hunt-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--device-shadow); margin-bottom: 14px; }

/* Hero stage: three phones in real depth, tilting with the pointer */
.stage { perspective: 1400px; margin: 28px auto 8px; height: 560px; max-width: 900px; position: relative; }
.stage-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--sx, 0deg)) rotateY(var(--sy, 0deg));
  transition: transform .25s ease-out;
}
.stage .phone { position: absolute; top: 50%; left: 50%; width: 220px; }
.stage .p-left   { transform: translate(-50%, -50%) translate3d(-250px, 20px, -80px) rotateY(24deg); }
.stage .p-center { transform: translate(-50%, -50%) translate3d(0, 0, 90px); width: 250px; z-index: 2; }
.stage .p-right  { transform: translate(-50%, -50%) translate3d(250px, 20px, -80px) rotateY(-24deg); }
.stage-glow {
  position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--device-glow), transparent 68%);
  transform: translate(-50%, -50%) translateZ(-160px);
}

/* A phone: frame, screen and a sheen that sweeps as it tilts */
.phone {
  aspect-ratio: 9 / 19.5; border-radius: 34px; padding: 8px;
  background: var(--device-frame); border: 1px solid var(--device-edge);
  box-shadow: var(--device-shadow); transform-style: preserve-3d; position: relative;
}
.phone .screen { width: 100%; height: 100%; border-radius: 27px; overflow: hidden; position: relative; background: var(--bg-deep); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.phone .screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, var(--device-sheen) 48%, transparent 66%);
  transform: translateX(var(--shine, -40%)); transition: transform .25s ease-out;
}
.phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; width: 64px; height: 16px; border-radius: 10px;
  background: var(--device-frame); transform: translateX(-50%) translateZ(2px); z-index: 3;
}

/* Scroll story: the phone stays pinned while the steps scroll past (Apple style) */
.scrolly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; margin: 64px 0 40px; align-items: start; }
.scrolly-visual { align-self: stretch; }
.scrolly-sticky { position: sticky; top: max(84px, calc(50vh - 290px)); display: flex; justify-content: center; perspective: 1400px; }
.scrolly-phone { width: 260px; transform: rotateY(var(--ry, -14deg)) rotateX(var(--rx, 4deg)); will-change: transform; }
.scrolly-phone .screen img { position: absolute; inset: 0; opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.scrolly-phone .screen img.active { opacity: 1; transform: none; }
.scrolly-steps { padding-bottom: 12vh; }
.step-card { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .5s ease; }
.step-card.active { opacity: 1; }
.step-copy h3 { margin-top: 0; font-size: 28px; color: var(--accent); }
.step-copy .step { display: block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.inline-shot { display: none; }

/* Without JavaScript the pinned phone is hidden and every step shows its own screen */
html:not(.js) .scrolly { display: block; }
html:not(.js) .scrolly-visual { display: none; }
html:not(.js) .step-card { opacity: 1; min-height: 0; margin: 48px 0; align-items: center; }
html:not(.js) .inline-shot { display: block; margin-bottom: 20px; width: min(60vw, 220px); }

@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.stage .phone { animation: float 6s ease-in-out infinite; }
.stage .p-center { animation-delay: -2s; }
.stage .p-right { animation-delay: -4s; }

.highlights { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 32px 0; }
.highlights li { background: var(--pill-bg); color: var(--pill-text); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; margin: 0; }

@media (max-width: 820px) {
  .scrolly { grid-template-columns: 1fr; gap: 0; margin-top: 40px; }
  .scrolly-visual { position: sticky; top: 70px; z-index: 2; align-self: start; padding: 10px 0 14px; }
  /* Text dissolves as it slides up under the phone; hunt.js sets --cut to where the phone ends (mask alpha only, not a visible color) */
  .step-copy { -webkit-mask-image: linear-gradient(to bottom, transparent var(--cut, -100px), black calc(var(--cut, -100px) + 80px)); mask-image: linear-gradient(to bottom, transparent var(--cut, -100px), black calc(var(--cut, -100px) + 80px)); }
  .scrolly-sticky { position: static; }
  .scrolly-phone { width: auto; height: min(34vh, 300px); }
  .step-card { min-height: 56vh; justify-content: flex-start; padding-top: 28px; }
  html:not(.js) .scrolly-visual { display: none; }
}
@media (max-width: 760px) {
  .stage { height: 440px; }
  .stage .phone { width: 150px; }
  .stage .p-center { width: 180px; }
  .stage .p-left { transform: translate(-50%, -50%) translate3d(-125px, 20px, -80px) rotateY(24deg); }
  .stage .p-right { transform: translate(-50%, -50%) translate3d(125px, 20px, -80px) rotateY(-24deg); }
  .stage-glow { width: 340px; height: 340px; }
  .phone { border-radius: 26px; padding: 6px; }
  .phone .screen { border-radius: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage .phone { animation: none; }
  .stage-inner, .phone .screen::after, .scrolly-phone .screen img, .step-card { transition: none; }
}

/* Custom Orders index cards, back link and the "next app" suggestion */
.back { margin: 0 0 12px; font-size: 15px; }
.app-cards { margin-top: 32px; }
.app-card { display: flex; gap: 18px; align-items: flex-start; }
.app-card h2, .app-card h3 { margin: 0 0 6px; }
.app-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--device-shadow); flex: none; }
.next-app { max-width: 640px; margin: 48px auto 32px; }
.next-app h2 { font-size: 22px; text-align: center; margin: 0 0 16px; }
