/* assets/css/app-detail.css | Purpose: The application detail page — hero, metadata chips,
   feature grid and screenshot gallery, plus exactly three reserved advertising sections.
   Loaded after site.css, so every colour comes from the locked --k-* palette; no rule body
   in this file carries a literal hex value.

   AD-SAFETY SHAPE OF THIS FILE (contract A1–A10):
     · Nothing here targets .adsbygoogle or .ad-slot, so no ad element is ever restyled,
       moved, resized, hidden or animated.
     · .ad-section and .ad-slot carry NO transform, opacity, filter, will-change or
       animation — they are static boxes in normal document flow.
     · .ad-section reserves min-height so the slot cannot shift layout when it fills.
     · Every animated section is separated from an ad by .ad-spacer (48px of static,
       un-animated space), which is more than the 32px the contract requires.
     · No position:fixed/sticky element exists on this page at all. The sticky mobile CTA
       that used to sit here was removed because it overlaid ad content (A4). */

/* ---------------------------------------------------------------- page */
.app-detail{padding-bottom:24px}

/* ---------------------------------------------------------------- hero
   The aurora is made of pre-rendered radial gradients that are moved with transform
   only. Nothing uses filter:blur on a live element, which keeps the layer cheap and
   keeps the compositor away from the advertising boxes below. */
.app-hero{position:relative;overflow:hidden;
  background:var(--k-grad-hero);color:var(--k-on-brand);
  padding:72px 0 64px}
.app-hero::before,
.app-hero::after{content:"";position:absolute;pointer-events:none;
  border-radius:50%;transform:translate3d(0,0,0)}
.app-hero::before{width:720px;height:720px;top:-320px;inset-inline-end:-180px;
  background:radial-gradient(circle,rgba(74,109,163,.55) 0%,rgba(74,109,163,0) 62%);
  animation:aurora-a 14s ease-in-out infinite alternate}
.app-hero::after{width:560px;height:560px;bottom:-280px;inset-inline-start:-140px;
  background:radial-gradient(circle,rgba(201,169,97,.30) 0%,rgba(201,169,97,0) 64%);
  animation:aurora-b 18s ease-in-out infinite alternate}
@keyframes aurora-a{from{transform:translate3d(0,0,0)}to{transform:translate3d(-60px,40px,0)}}
@keyframes aurora-b{from{transform:translate3d(0,0,0)}to{transform:translate3d(50px,-36px,0)}}
.app-hero .wrap{position:relative;z-index:1}

.app-hero-grid{display:grid;grid-template-columns:auto 1fr;gap:32px;align-items:center}

/* Icon: the 3D tilt is applied by app-detail.js through --tilt-x / --tilt-y, so the
   stylesheet stays declarative and reduced-motion can switch it off in one place. */
.app-icon-wrap{position:relative;width:112px;height:112px;flex-shrink:0;
  perspective:700px}
.app-icon{width:112px;height:112px;border-radius:var(--k-radius-lg);display:block;
  transform:rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg));
  transition:transform .25s ease;box-shadow:var(--k-shadow),0 0 0 1px var(--k-gold-line);
  background:var(--k-surface);object-fit:cover}
.app-icon-fallback{display:grid;place-items:center;font-family:var(--k-font);
  font-weight:700;font-size:2.6rem;color:var(--k-primary);
  background:linear-gradient(135deg,var(--k-bg),var(--k-gold-soft))}
/* Specular highlight that follows the pointer. */
.app-icon-wrap::after{content:"";position:absolute;inset:0;border-radius:var(--k-radius-lg);
  pointer-events:none;opacity:0;transition:opacity .25s ease;
  background:radial-gradient(180px 180px at var(--glint-x,50%) var(--glint-y,50%),
    rgba(255,255,255,.55),rgba(255,255,255,0) 60%)}
.app-icon-wrap.is-tilting::after{opacity:1}

.app-hero h1{font-size:clamp(2rem,4.6vw,3.2rem);font-weight:800;letter-spacing:-.03em;
  color:var(--k-on-brand);margin-bottom:6px}
.app-hero .app-name-ar{font-size:1.25rem;color:var(--k-gold);margin-bottom:10px}
.app-hero .app-platform{font-family:var(--k-mono);font-size:.75rem;letter-spacing:.06em;
  text-transform:uppercase;color:var(--k-primary-soft);opacity:.85}
/* Thin animated gold rule — transform-only, and it never sits near an ad box. */
.gold-rule{height:2px;width:120px;margin:18px 0 22px;border-radius:2px;
  background:var(--k-grad-gold);background-size:200% 100%;
  animation:gold-sweep 2.6s linear infinite}
@keyframes gold-sweep{from{background-position:0 0}to{background-position:200% 0}}

/* ---------------------------------------------------------------- metadata chips
   Only facts that exist in the record are rendered. No rating and no download count is
   printed anywhere, because this project stores neither. */
.meta-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.meta-chip{display:inline-flex;align-items:center;gap:7px;
  font-family:var(--k-mono);font-size:.72rem;letter-spacing:.03em;
  padding:6px 12px;border-radius:100px;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);
  color:var(--k-on-brand)}
.meta-chip b{font-weight:700;color:var(--k-gold)}
.meta-chip .k{opacity:.78;text-transform:uppercase}

/* ---------------------------------------------------------------- hero actions */
.app-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}
.btn-shine{position:relative;overflow:hidden}
.btn-shine::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.42) 50%,transparent 80%);
  transform:translateX(-120%)}
.btn-shine:hover::after{transform:translateX(120%);transition:transform .7s ease}

/* ---------------------------------------------------------------- sections */
.app-section{padding:56px 0}
.app-section h2{font-size:clamp(1.5rem,3vw,2.05rem);margin-bottom:8px}
.app-section .sec-lead{color:var(--k-muted);max-width:62ch;margin-bottom:28px}
.summary{max-width:70ch;color:var(--k-text);font-size:1.05rem;line-height:1.75}
.summary p+p{margin-top:1em}

/* Divider between content blocks: a gold gradient moved with transform only. */
.section-divider{height:1px;background:var(--k-line);position:relative;overflow:hidden}
.section-divider::after{content:"";position:absolute;inset-block:0;width:180px;
  background:var(--k-grad-gold);transform:translateX(-100%);
  animation:divider-sweep 4.5s ease-in-out infinite}
@keyframes divider-sweep{0%{transform:translateX(-100%)}55%{transform:translateX(680px)}
  100%{transform:translateX(680px)}}

/* ---------------------------------------------------------------- features */
.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.feature-card{background:var(--k-bg);border:1px solid var(--k-line);
  border-radius:var(--k-radius);padding:26px;position:relative;
  box-shadow:var(--k-shadow-sm);
  transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease}
.feature-card:hover{transform:translateY(-4px);border-color:var(--k-gold);
  box-shadow:var(--k-shadow-md),var(--k-glow-gold)}
.feature-icon{width:44px;height:44px;border-radius:var(--k-radius-sm);display:grid;
  place-items:center;margin-bottom:16px;background:var(--k-primary-soft);
  color:var(--k-primary)}
.feature-icon svg{width:22px;height:22px;display:block}
.feature-card h3{font-size:1.05rem;margin-bottom:8px}
.feature-card p{color:var(--k-muted);font-size:.92rem;line-height:1.6}
/* Staggered entrance is opt-in: the class is added by script so the no-JS state is the
   finished state, and it is dropped entirely under reduced motion. */
.feature-card.is-entering{opacity:0;transform:translateY(18px)}
.feature-card.is-entered{opacity:1;transform:none;
  transition:opacity .5s ease,transform .5s cubic-bezier(.2,.7,.2,1),
             border-color .25s ease,box-shadow .25s ease}

/* ---------------------------------------------------------------- gallery */
.gallery{display:flex;gap:18px;overflow-x:auto;padding:6px 2px 18px;
  scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;align-items:flex-start}
.gallery-item{flex:0 0 auto;scroll-snap-align:center;position:relative;
  border-radius:var(--k-radius-lg);overflow:hidden;border:1px solid var(--k-line);
  background:var(--k-surface);box-shadow:var(--k-shadow-sm)}
.gallery-item img{display:block;width:210px;height:auto;
  transition:transform .35s ease}
.gallery-item:hover img{transform:scale(1.04)}
/* Gold shimmer sweep across the active frame. */
.gallery-item::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(100deg,transparent 30%,rgba(201,169,97,.28) 50%,transparent 70%);
  transform:translateX(-120%);transition:transform .6s ease}
.gallery-item:hover::after{transform:translateX(120%)}
.gallery-nav{display:flex;gap:10px;align-items:center;margin-top:12px}
.gallery-nav button{width:38px;height:38px;border-radius:var(--k-radius-sm);
  border:1px solid var(--k-line);background:var(--k-bg);color:var(--k-primary);
  cursor:pointer;font-size:1rem;line-height:1}
.gallery-nav button:hover{border-color:var(--k-primary);box-shadow:var(--k-glow-blue)}
.gallery-count{font-family:var(--k-mono);font-size:.74rem;color:var(--k-muted);
  margin-inline-start:6px}

/* ---------------------------------------------------------------- ADS — static by design
   No transform, opacity, filter, will-change or animation reaches these rules. The
   min-height is the CLS reservation (contract A6) and is present before the AdSense
   script runs because this stylesheet is a <link> in <head>. */
.ad-section{max-width:var(--maxw);margin:0 auto;padding:0 24px;
  min-height:100px;display:block}
.ad-spacer{height:48px}      /* static, un-animated separation from animated content */
.ad-slot{max-width:var(--maxw);margin:0 auto;min-height:100px;padding:0;
  display:flex;justify-content:center;align-items:center;
  background:var(--k-surface);border:1px dashed var(--k-line);
  border-radius:var(--k-radius)}
.ad-slot:empty{display:none}
.ad-slot ins{display:block;width:100%}
.ad-slot .ad-placeholder{font-family:var(--k-mono);font-size:.68rem;letter-spacing:.12em;
  color:var(--k-muted-faint);text-transform:uppercase;padding:28px 12px;text-align:center}

/* ---------------------------------------------------------------- misc */
.app-empty{border:1px dashed var(--k-line);border-radius:var(--k-radius);
  padding:28px;color:var(--k-muted);background:var(--k-surface)}
.preview-banner{background:var(--k-secondary);color:var(--k-on-brand);text-align:center;
  padding:10px 16px;font-family:var(--k-mono);font-size:.82rem;font-weight:700}

/* Focus rings in gold (contract: visible, gold). */
.app-detail :focus-visible{outline:2px solid var(--k-gold);outline-offset:3px;
  border-radius:var(--k-radius-sm)}

/* ---------------------------------------------------------------- responsive */
@media(max-width:900px){
  .feature-grid{grid-template-columns:1fr 1fr}
  .app-hero-grid{grid-template-columns:1fr;gap:22px}
}
@media(max-width:620px){
  .feature-grid{grid-template-columns:1fr}
  .app-hero{padding:48px 0 40px}
  .app-icon-wrap,.app-icon{width:88px;height:88px}
}

/* ---------------------------------------------------------------- reduced motion
   Every animation on this page collapses to its finished state. The 3D tilt is disabled
   by neutralising the custom properties the script writes. */
@media(prefers-reduced-motion:reduce){
  .app-hero::before,.app-hero::after,.gold-rule,.section-divider::after{animation:none}
  .app-icon{transform:none}
  .app-icon-wrap::after{display:none}
  .btn-shine::after,.gallery-item::after{display:none}
  .feature-card,.feature-card.is-entering{opacity:1;transform:none}
  .gallery-item:hover img{transform:none}
  .feature-card:hover{transform:none}
}
