/* ==========================================================================
   MOBILE APP DETAIL PAGES (routes/neon-zenith.html, listy.html, adi.html)
   Loaded after style.css; reuses its tokens, .reveal and .photo-modal.
   ========================================================================== */

.app-page {
  --shot-ratio: 9 / 19.5;
  --shot-bg: #2a2a2a;
  --hero-bg: var(--color-warm-highlight);
  --hero-text: var(--color-dark);
  --hero-muted: rgba(58, 58, 58, 0.7);
  --hero-rule: rgba(58, 58, 58, 0.15);
  background: var(--color-cream);
}

.app-page--neon {
  --shot-ratio: 1080 / 2316;
  --shot-bg: #0a0d1c;
  --hero-bg: #070a18;
  --hero-text: var(--color-cream);
  --hero-muted: rgba(249, 244, 235, 0.65);
  --hero-rule: rgba(249, 244, 235, 0.15);
}

.app-page--adi {
  --shot-ratio: 1080 / 2118;
  --shot-bg: #f4f1ea;
}

.app-page--listy {
  --shot-ratio: 1080 / 2097;
  --shot-bg: #f8fafb;
}

/* Logo tiles (hero + "more apps") */
.tile--neon {
  background: radial-gradient(circle at 50% 45%, #2a1b5e 0%, #0b1026 70%);
}

.tile--listy,
.tile--adi {
  background: #fff;
}

/* --------------------------------------------------------------------------
   Header (matches the other route pages)
   -------------------------------------------------------------------------- */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.back-link {
  position: absolute;
  left: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-cream);
  text-decoration: none;
  transition: all var(--duration-medium) var(--ease-out-expo);
}

.back-link:hover {
  background: var(--color-orange);
  border-color: var(--color-orange);
  transform: scale(1.05);
}

.back-link i {
  font-size: 1.5rem;
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-cream);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.app-hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-2xl) + var(--space-lg)) var(--space-xl) var(--space-2xl);
  background: var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
}

/* Neon Zenith: animated stand-in for the blurred key art (SVG shares the artwork's 1536x1024 space) */
.neon-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.neon-bg svg {
  position: absolute;
  inset: -60px;
  display: block;
  width: calc(100% + 120px);
  height: calc(100% + 120px);
  filter: blur(18px) saturate(1.3);
}

/* keeps the text column readable over the orbs */
.neon-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 10, 24, 0) 28%, rgba(7, 10, 24, 0.75) 58%, rgba(7, 10, 24, 0.85) 100%);
}

.nb-drift,
.nb-float,
.nb-spin,
.nb-pulse,
.nb-twinkle,
.nb-ship {
  transform-box: fill-box;
  transform-origin: center;
}

.nb-drift { animation: nb-drift var(--d, 28s) ease-in-out var(--delay, 0s) infinite alternate; }
.nb-float { animation: nb-float var(--d, 10s) ease-in-out var(--delay, 0s) infinite alternate; }
.nb-spin { animation: nb-spin var(--d, 24s) linear var(--delay, 0s) infinite; }
.nb-pulse { animation: nb-pulse var(--d, 6s) ease-in-out var(--delay, 0s) infinite; }
.nb-twinkle { animation: nb-twinkle var(--d, 4s) ease-in-out var(--delay, 0s) infinite; }
.nb-ship { animation: nb-ship var(--d, 10s) ease-in-out var(--delay, 0s) infinite; }
.nb-aim { animation: nb-aim 5s ease-in-out infinite alternate; }

.nb-streak {
  stroke-dasharray: 140 2000;
  animation: nb-streak var(--d, 7s) linear var(--delay, 0s) infinite;
}

.neon-bg.is-paused * {
  animation-play-state: paused;
}

@keyframes nb-drift {
  from { transform: translate(-40px, -24px) scale(1); }
  to   { transform: translate(50px, 30px) scale(1.12); }
}

@keyframes nb-float {
  from { transform: translate(-8px, -16px) rotate(-3deg); }
  to   { transform: translate(8px, 16px) rotate(3deg); }
}

@keyframes nb-spin {
  to { transform: rotate(360deg); }
}

@keyframes nb-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50%      { opacity: 1; transform: scale(1.08); }
}

@keyframes nb-twinkle {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.95; }
}

@keyframes nb-streak {
  0%   { stroke-dashoffset: 140; opacity: 0; }
  10%  { opacity: 1; }
  60%  { stroke-dashoffset: -1000; opacity: 1; }
  70%, 100% { stroke-dashoffset: -1000; opacity: 0; }
}

@keyframes nb-ship {
  0%   { transform: translate(-150px, 100px); opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  85%, 100% { transform: translate(220px, -150px); opacity: 0; }
}

@keyframes nb-aim {
  from { transform: rotate(-14deg); }
  to   { transform: rotate(14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .neon-bg * {
    animation: none !important;
  }
}

/* stacked layout: the text sits below the key art, so darken downwards instead of sideways */
@media (max-width: 900px) {
  .neon-bg svg {
    opacity: 0.6;
  }

  .neon-bg::after {
    background: linear-gradient(180deg, rgba(7, 10, 24, 0) 25%, rgba(7, 10, 24, 0.82) 50%, rgba(7, 10, 24, 0.9) 100%);
  }
}

.app-hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.app-page--neon .app-hero-inner {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.app-hero-logo {
  aspect-ratio: 1;
  border-radius: 28px;
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 60px rgba(86, 43, 14, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.app-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-hero-art {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(62, 230, 255, 0.25),
    0 0 60px rgba(176, 82, 255, 0.25);
}

.app-hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

.app-hero-text .section-label {
  margin-bottom: var(--space-xs);
}

.app-hero-title {
  font-size: var(--font-size-3xl);
  color: var(--hero-text);
  margin-bottom: var(--space-xs);
}

.app-hero-tagline {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-orange);
  margin-bottom: var(--space-md);
}

.app-page--neon .app-hero-tagline {
  background: linear-gradient(90deg, #3ee6ff, #ff7ad9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-hero-summary {
  font-size: var(--font-size-md);
  color: var(--hero-muted);
  margin-bottom: var(--space-lg);
}

.app-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-xl);
  padding-top: var(--space-md);
  margin-bottom: var(--space-lg);
  border-top: 1px solid var(--hero-rule);
}

.app-facts dt {
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hero-muted);
}

.app-facts dd {
  font-weight: 600;
}

/* Buttons */
.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.5em;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--hero-text);
  border: 1px solid currentColor;
  border-radius: 4px;
  transition: all var(--duration-medium) var(--ease-out-expo);
}

.app-btn:hover {
  transform: translateY(-3px);
  background: var(--color-dark);
  border-color: var(--color-dark);
  color: var(--color-cream);
}

.app-btn--primary {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: #fff;
}

.app-btn--primary:hover {
  box-shadow: 0 8px 20px rgba(254, 81, 20, 0.3);
}

.app-page--neon .app-btn:hover {
  background: var(--color-cream);
  border-color: var(--color-cream);
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.app-section {
  padding: var(--space-2xl) var(--space-xl);
}

.app-section--warm {
  background: var(--color-warm-highlight);
}

.app-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.app-section .section-header-portfolio {
  margin-bottom: var(--space-xl);
}

/* About - editorial split */
.app-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-xl);
}

.app-about .section-title {
  margin-top: var(--space-xs);
}

.app-about-body p {
  font-size: var(--font-size-md);
  line-height: 1.75;
  color: var(--color-dark);
}

.app-about-body p + p {
  margin-top: var(--space-md);
}

/* Feature cards */
.app-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-lg);
}

.app-features--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.app-feature {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: transform var(--duration-medium) var(--ease-out-expo),
              box-shadow var(--duration-medium) var(--ease-out-expo);
}

.app-feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.app-feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-md);
  border-radius: 12px;
  background: rgba(254, 81, 20, 0.1);
  color: var(--color-orange);
  font-size: 1.2rem;
}

.app-feature h3 {
  font-size: var(--font-size-md);
  color: var(--color-dark);
  margin-bottom: var(--space-xs);
}

.app-feature p {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--color-gray);
}

/* Trailer + checklist */
.app-trailer {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.app-checklist {
  list-style: none;
}

.app-checklist li {
  display: flex;
  gap: 0.85em;
  padding: 0.8em 0;
  border-bottom: 1px solid rgba(58, 58, 58, 0.12);
}

.app-checklist li i {
  color: var(--color-orange);
  margin-top: 0.3em;
}

.app-trailer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-orange);
  text-decoration: none;
}

.app-trailer-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Screenshot frames
   -------------------------------------------------------------------------- */

.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: var(--space-lg);
}

.shots-grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.shot-frame {
  margin: 0;
  padding: 0 8px 8px;
  background: var(--color-dark);
  border-top: 3px solid var(--color-orange);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(26, 26, 26, 0.18);
  transition: transform var(--duration-medium) var(--ease-out-expo),
              box-shadow var(--duration-medium) var(--ease-out-expo);
}

.shot-frame:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 60px rgba(26, 26, 26, 0.28), 0 0 0 2px var(--color-orange);
}

.shot-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  min-height: 46px;
  padding: 0 4px;
  font-size: var(--font-size-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-cream);
}

.shot-frame-count {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: rgba(249, 244, 235, 0.5);
}

.shot-frame-count b {
  color: var(--color-orange);
}

.shot-frame-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-frame-screen {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: var(--shot-ratio);
  background: var(--shot-bg);
  cursor: zoom-in;
}

.shot-frame-screen:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

.shot-frame-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shot-frame--video {
  width: 100%;
}

.shot-frame--video .shot-frame-screen {
  aspect-ratio: 9 / 16;
  cursor: auto;
}

.shot-frame-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lightbox: no visibility delay on open, so focus can move to the close button */
#shotsModal.active {
  transition: opacity 0.4s var(--ease-out-expo);
}

#shotsModal .photo-modal-close,
#shotsModal .photo-modal-nav {
  transition-property: background-color, color, border-color, transform, opacity;
}

/* --------------------------------------------------------------------------
   Tech stack
   -------------------------------------------------------------------------- */

.app-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-xl) var(--space-lg);
}

.app-stack-group h3 {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-orange);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(58, 58, 58, 0.15);
}

.app-stack-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.app-stack-group li {
  padding: 0.35em 0.85em;
  font-size: var(--font-size-sm);
  background: #fff;
  border: 1px solid rgba(58, 58, 58, 0.12);
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Closing band + more apps
   -------------------------------------------------------------------------- */

.app-closing {
  padding: var(--space-2xl) var(--space-xl);
  background: var(--color-ink);
  color: var(--color-cream);
  text-align: center;
}

.app-closing p {
  max-width: 900px;
  margin: 0 auto;
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.app-closing em {
  font-style: normal;
  color: var(--color-orange);
}

.app-closing .app-actions {
  justify-content: center;
  margin-top: var(--space-lg);
}

.app-closing .app-btn {
  color: var(--color-cream);
}

.app-closing .app-btn--primary {
  color: #fff;
}

.app-closing .app-btn:hover {
  background: var(--color-cream);
  border-color: var(--color-cream);
  color: var(--color-ink);
}

.app-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-lg);
  max-width: 820px;
  margin: 0 auto;
}

.app-more-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: all var(--duration-medium) var(--ease-out-expo);
}

.app-more-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-orange);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.app-more-logo {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.app-more-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-more-card strong {
  display: block;
  font-size: var(--font-size-md);
  color: var(--color-dark);
}

.app-more-card span {
  font-size: var(--font-size-sm);
  color: var(--color-gray);
}

.app-more-card .fa-arrow-right {
  margin-left: auto;
  color: var(--color-orange);
  transition: transform var(--duration-fast);
}

.app-more-card:hover .fa-arrow-right {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .app-hero-inner,
  .app-page--neon .app-hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .app-hero-logo {
    width: min(220px, 60%);
  }

  .app-about,
  .app-trailer {
    grid-template-columns: 1fr;
  }

  .shot-frame--video {
    max-width: 340px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: var(--space-md);
  }

  .back-link {
    left: var(--space-md);
  }

  .page-title {
    font-size: var(--font-size-lg);
  }

  .app-hero,
  .app-section,
  .app-closing {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

@media (max-width: 600px) {
  .shots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .shot-frame {
    padding: 0 5px 5px;
    border-radius: 10px;
  }

  .shot-frame-bar {
    min-height: 36px;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }
}
