/* ============================================================================
   assets/css/apps-list.css | Purpose: the /apps/ catalog chrome — redesigned topbar,
   3D hero carousel, the fixed request button and its modal.

   Loaded only by the catalog and the application detail page (via
   views/public/_partials/styles.php). It consumes the locked palette from site.css
   (--k-primary royal blue, --k-secondary crimson, --k-gold gold, --k-* neutrals) and
   defines no colour of its own, so the two files cannot drift apart.

   ── AD SAFETY (contract A1–A11 in AD-SAFETY-REPORT-apps-v5.md) ─────────────
   Nothing in this file targets .ad-slot, .ad-unit, .adsbygoogle or any `<ins>`:
   no transform, no filter, no opacity, no perspective, no will-change, no fixed or
   sticky positioning. The advertising unit keeps its own layout in normal flow.
   Gold is used as ornament and as a glow ONLY — never as the colour of text that has
   to be read, because --k-gold measures 2.25:1 on white.
   ============================================================================ */

/* ---------------------------------------------------------------- topbar
   Sticky (not fixed) so it can never be layered over the ad unit, which lives in
   normal flow far below it. */
.apps-topbar{
  position:sticky;top:0;z-index:60;
  height:72px;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--k-line);
  transition:height .2s ease,box-shadow .2s ease,background .2s ease;
}
@supports (backdrop-filter:blur(10px)){
  .apps-topbar{backdrop-filter:blur(10px)}
}
.apps-topbar.is-compact{height:56px;box-shadow:0 6px 22px rgba(10,22,40,.07)}

.apps-topbar-inner{
  position:relative;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  height:100%;max-width:1180px;margin:0 auto;padding:0 20px;
}

/* Left zone: home mark, then the language switch beside it. */
.apps-topbar-left{display:flex;align-items:center;gap:10px;min-width:0}

.topbar-brand{display:inline-flex;align-items:center;gap:9px;text-decoration:none;
  color:var(--k-primary);flex:0 0 auto;border-radius:12px;padding:6px 8px;margin:-6px -8px;
  transition:background .2s ease,color .2s ease}
.topbar-brand:hover{background:var(--k-primary-soft);color:var(--k-primary-600)}
.topbar-brand:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}
.topbar-brand-mark{width:26px;height:26px;display:block;flex:0 0 auto;min-width:24px;min-height:24px}
.topbar-brand-text{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:600;
  font-size:1rem;letter-spacing:-.01em;white-space:nowrap}
.topbar-brand-dot{color:var(--k-gold)}

/* Language switch: one real navigation to the other language. */
.topbar-lang{position:relative;overflow:hidden;
  display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;
  font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:600;font-size:.82rem;
  text-decoration:none;color:var(--k-primary);
  border:1px solid var(--k-line);background:var(--k-surface);
  border-radius:100px;padding:7px 13px;
  transition:border-color .2s ease,color .2s ease,box-shadow .2s ease}
.topbar-lang-icon{width:22px;height:22px;display:block;flex:0 0 auto}
.topbar-lang:hover{border-color:var(--k-gold);color:var(--k-primary-600);
  box-shadow:0 4px 16px rgba(201,169,97,.30)}
.topbar-lang:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}
/* Shine sweep on hover: transform only, on the button's own pseudo-element. */
.topbar-lang::after{content:"";position:absolute;inset:0;
  background:linear-gradient(105deg,transparent 28%,rgba(201,169,97,.42) 50%,transparent 72%);
  transform:translateX(-130%);transition:transform .65s ease;pointer-events:none}
.topbar-lang:hover::after{transform:translateX(130%)}

/* Centre zone: brand name with the mark beneath it, centred on the BAR AXIS.
   Absolutely positioned so neither side zone can push it off centre. */
.apps-topbar-center{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  pointer-events:none;text-align:center}
.topbar-studio{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:700;
  font-size:1.1rem;line-height:1.1;letter-spacing:-.015em;color:var(--k-primary);white-space:nowrap}
.topbar-studio-logo{display:block;line-height:0}
.topbar-studio-logo svg{width:32px;height:32px;display:block}

/* Right zone: small facts plus one navigation link. Never wraps — wrap would change
   the bar height and that is layout shift. */
.apps-topbar-right{display:flex;align-items:center;gap:14px;flex:0 0 auto;justify-content:flex-end}
.topbar-stat{display:none;flex-direction:column;align-items:flex-end;line-height:1.15}
.topbar-stat strong{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.86rem;color:var(--k-primary)}
.topbar-stat em{font-style:normal;font-size:.62rem;letter-spacing:.07em;text-transform:uppercase;
  color:var(--k-muted-faint)}
.topbar-nav-link{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:500;
  font-size:.86rem;color:var(--k-muted);text-decoration:none;white-space:nowrap;
  padding:8px 4px;transition:color .2s ease}
.topbar-nav-link:hover{color:var(--k-primary)}
.topbar-nav-link:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}

@media (min-width:900px){ .topbar-stat{display:flex} }

/* Phone: ONE row, fixed 56px. No dropdown, no burger — every element stays visible
   and the height cannot depend on wrapping. */
@media (max-width:760px){
  .apps-topbar{height:56px}
  .apps-topbar.is-compact{height:56px}
  .apps-topbar-inner{padding:0 12px;gap:6px}
  .topbar-brand-text{display:none}
  .topbar-brand{padding:8px}
  .topbar-lang{padding:6px 10px;gap:5px}
  .topbar-lang-text{font-size:.74rem}
  .topbar-studio{font-size:1.02rem}
  .topbar-studio-logo svg{width:28px;height:28px}
  .topbar-nav-link{display:none}
}
@media (max-width:879px){ .topbar-stat{display:none} }

/* ---------------------------------------------------------------- hero panel
   Sits directly under the topbar. The 32px gap to the advertising unit is enforced
   by .ad-slot's own margin in the list view, not by anything here. */
.hero-panel{
  position:relative;
  margin:22px auto 0;max-width:1180px;
  min-height:460px;
  padding:0 20px;
  perspective:1400px;
}
/* The moving light behind the carousel: transform + opacity only, so it stays on the
   compositor and never repaints the page. aria-hidden and pointer-events:none keep it
   out of the accessibility tree and out of hit-testing. */
.hero-blob{
  position:absolute;inset:auto 8% 6% 8%;height:58%;
  background:radial-gradient(48% 60% at 32% 45%,rgba(26,58,107,.16),transparent 70%),
             radial-gradient(40% 55% at 72% 60%,rgba(201,169,97,.20),transparent 72%);
  filter:blur(26px);opacity:.85;transform:translate3d(0,0,0);
  pointer-events:none;z-index:0;
  animation:hero-blob-drift 16s ease-in-out infinite alternate;
}
@keyframes hero-blob-drift{
  from{transform:translate3d(-2%,1.5%,0) scale(1);opacity:.72}
  to{transform:translate3d(2%,-1.5%,0) scale(1.07);opacity:.95}
}

/* Side vignette. A mask (not a transform/filter) on our own stage element. */
.hero-stage{
  position:relative;z-index:1;
  height:340px;
  -webkit-mask-image:linear-gradient(to right,transparent 0%,black 15%,black 85%,transparent 100%);
          mask-image:linear-gradient(to right,transparent 0%,black 15%,black 85%,transparent 100%);
}
.hero-track{position:relative;height:100%;transform-style:preserve-3d}

.hero-slide{
  position:absolute;top:0;inset-inline-start:50%;
  width:min(720px,74%);
  display:flex;flex-direction:column;overflow:hidden;
  border:1px solid var(--k-line);border-radius:22px;background:var(--k-bg);
  box-shadow:0 18px 48px rgba(10,22,40,.14);
  text-decoration:none;color:inherit;
  opacity:0;pointer-events:none;visibility:hidden;
  transform:translateX(-50%) translateZ(-90px) scale(.9);
  transition:opacity .7s cubic-bezier(.4,0,.2,1),
             transform .7s cubic-bezier(.4,0,.2,1),
             visibility 0s linear .7s;
  will-change:transform,opacity;
}
[dir="rtl"] .hero-slide{transform:translateX(50%) translateZ(-90px) scale(.9)}

.hero-slide.is-active{
  opacity:1;pointer-events:auto;visibility:visible;z-index:3;
  transform:translateX(-50%) translateZ(0) scale(1);
  transition-delay:0s;
}
[dir="rtl"] .hero-slide.is-active{transform:translateX(50%) translateZ(0) scale(1)}

/* Side slides recede on the Z axis and dim — matching the transition above so the
   depth reads as one continuous movement rather than a swap. */
.hero-slide.is-prev,
.hero-slide.is-next{
  opacity:.34;pointer-events:none;visibility:visible;z-index:1;
  transform:translateX(-50%) translateZ(-50px) scale(.86);
}
[dir="rtl"] .hero-slide.is-prev,
[dir="rtl"] .hero-slide.is-next{transform:translateX(50%) translateZ(-50px) scale(.86)}
.hero-slide.is-prev{inset-inline-start:26%}
.hero-slide.is-next{inset-inline-start:74%}

.hero-slide-img{display:block;width:100%;height:262px;object-fit:cover;background:var(--k-surface)}
/* Fallback plate for an application that has no artwork yet: a generated gradient keyed
   to the slug's own hue, carrying the real first letter of the name. No invented imagery. */
.hero-slide-plate{display:grid;place-items:center;width:100%;height:262px;
  background:linear-gradient(135deg,
    hsl(var(--slide-hue,212),46%,30%),
    hsl(calc(var(--slide-hue,212) + 28),52%,16%))}
.hero-slide-initial{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:800;
  font-size:4.6rem;line-height:1;color:rgba(255,255,255,.9)}
.hero-slide-veil{position:absolute;inset:0 0 auto 0;height:262px;
  background:linear-gradient(to top,rgba(10,22,40,.72),rgba(10,22,40,.06) 58%,transparent);
  pointer-events:none}
.hero-slide-copy{position:absolute;inset-inline:22px;bottom:18px;display:flex;flex-direction:column;gap:4px;
  color:#fff;pointer-events:none}
.hero-slide-name{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:700;
  font-size:clamp(1.05rem,2.2vw,1.5rem);line-height:1.2}
.hero-slide-tag{font-size:.9rem;color:rgba(255,255,255,.86);
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}

.hero-arrow{
  position:absolute;top:50%;transform:translateY(-50%);z-index:4;
  width:44px;height:44px;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;
  border:1px solid var(--k-line);background:rgba(255,255,255,.94);color:var(--k-primary);
  box-shadow:0 6px 18px rgba(10,22,40,.12);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.hero-arrow:hover{border-color:var(--k-gold);box-shadow:0 8px 24px rgba(201,169,97,.28)}
.hero-arrow:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}
.hero-arrow:active{transform:translateY(-50%) scale(.94)}
.hero-arrow-prev{inset-inline-start:14px}
.hero-arrow-next{inset-inline-end:14px}

.hero-dots{position:absolute;inset-inline:0;bottom:-6px;z-index:4;
  display:flex;align-items:center;justify-content:center;gap:10px}
.hero-dot{width:9px;height:9px;padding:0;border-radius:50%;cursor:pointer;
  border:1px solid var(--k-primary);background:transparent;
  transition:transform .25s ease,background .25s ease,width .25s ease}
.hero-dot:hover{background:var(--k-primary-soft)}
.hero-dot.is-active{width:26px;border-radius:100px;background:var(--k-primary);border-color:var(--k-primary)}
.hero-dot:focus-visible{outline:2px solid var(--k-primary);outline-offset:3px}

/* Phone: one 280px slide, no peeking neighbours, dots only. */
@media (max-width:760px){
  .hero-panel{min-height:380px;padding:0 14px;margin-top:16px}
  .hero-stage{height:280px}
  .hero-slide{width:100%;border-radius:18px}
  .hero-slide-img{height:192px}
  .hero-slide-plate{height:192px}
  .hero-slide-initial{font-size:3.4rem}
  .hero-slide-veil{height:192px}
  .hero-slide.is-prev,
  .hero-slide.is-next{opacity:0;visibility:hidden;transform:translateX(-50%) translateZ(-50px) scale(.9)}
  [dir="rtl"] .hero-slide.is-prev,
  [dir="rtl"] .hero-slide.is-next{transform:translateX(50%) translateZ(-50px) scale(.9)}
  .hero-arrow{display:none}
  .hero-slide-copy{inset-inline:16px;bottom:14px}
}
@media (min-width:1180px){ .hero-stage{height:360px} }

/* Reduced motion: the carousel still changes slide, it just does not travel. */
@media (prefers-reduced-motion:reduce){
  .apps-topbar,.topbar-brand,.topbar-lang,.topbar-lang::after,
  .hero-slide,.hero-arrow,.hero-dot{transition:none !important}
  .hero-blob{animation:none !important}
  .hero-slide{transition:opacity 0s linear 0s !important}
  .hero-slide.is-active{transform:translateX(-50%) scale(1)}
  [dir="rtl"] .hero-slide.is-active{transform:translateX(50%) scale(1)}
}

/* ---------------------------------------------------------------- request button
   Fixed, bottom-left on desktop, bottom-centre on a phone. z-index 70 is below the
   modal (80) and never covers the ad unit, which is in normal flow. */
.request-fab{
  position:fixed;z-index:70;
  bottom:24px;left:24px;
  min-width:56px;min-height:56px;
  display:inline-flex;align-items:center;gap:10px;
  padding:0 20px 0 17px;border:0;border-radius:100px;cursor:pointer;
  background:var(--k-secondary);color:var(--k-on-brand);
  font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:700;font-size:.92rem;
  box-shadow:0 12px 30px rgba(200,16,46,.34);
  transition:transform .2s ease,box-shadow .2s ease,background .2s ease}
.request-fab:hover{background:var(--k-secondary-700);box-shadow:0 16px 36px rgba(200,16,46,.42)}
.request-fab:active{transform:scale(.96)}
.request-fab:focus-visible{outline:3px solid var(--k-gold);outline-offset:3px}
.request-fab-icon{width:24px;height:24px;display:block;flex:0 0 auto}
@media (max-width:760px){
  .request-fab{bottom:16px;left:50%;transform:translateX(-50%);padding:0 18px}
  .request-fab:active{transform:translateX(-50%) scale(.96)}
  .request-fab-text{font-size:.88rem}
}
/* RTL: the bar mirrors to the other corner, away from the reading start edge. */
[dir="rtl"] .request-fab{left:auto;right:24px}
@media (max-width:760px){
  [dir="rtl"] .request-fab{right:auto;left:50%;transform:translateX(-50%)}
}

/* ---------------------------------------------------------------- request modal */
.request-overlay{position:fixed;inset:0;z-index:75;background:rgba(10,22,40,.6);
  animation:request-fade .22s ease both}
.request-panel{position:fixed;z-index:80;inset:0;display:grid;place-items:center;
  padding:22px;pointer-events:none}
.request-panel[hidden],.request-overlay[hidden]{display:none}
.request-form{pointer-events:auto;position:relative;
  width:min(560px,100%);max-height:min(88vh,760px);overflow:auto;
  background:var(--k-bg);border-radius:22px;border:1px solid var(--k-line);
  box-shadow:0 30px 70px rgba(10,22,40,.34);
  padding:28px;
  animation:request-rise .32s cubic-bezier(.4,0,.2,1) both}
@keyframes request-fade{from{opacity:0}to{opacity:1}}
@keyframes request-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}

.request-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.request-head h2{font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:700;
  font-size:1.4rem;color:var(--k-primary);line-height:1.25}
.request-close{flex:0 0 auto;width:38px;height:38px;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;border:1px solid var(--k-line);background:var(--k-bg);
  color:var(--k-muted);transition:color .2s ease,border-color .2s ease,transform .2s ease}
.request-close:hover{color:var(--k-secondary);border-color:var(--k-secondary);transform:rotate(90deg)}
.request-close:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}

.request-lede{color:var(--k-muted);font-size:.92rem;margin:10px 0 18px}
.request-label{display:block;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;
  font-weight:600;font-size:.88rem;color:var(--k-primary);margin:0 0 7px}
.request-form textarea,.request-form input[type="text"]{
  width:100%;background:var(--k-bg);border:1px solid var(--k-line);color:var(--k-text, #16202e);
  border-radius:12px;padding:12px 14px;font-family:inherit;font-size:.94rem;
  transition:border-color .2s ease,box-shadow .2s ease}
.request-form textarea{resize:vertical;min-height:118px}
.request-form textarea:focus,.request-form input[type="text"]:focus{outline:none;
  border-color:var(--k-primary);box-shadow:0 0 0 3px rgba(26,58,107,.13)}
.request-form textarea[aria-invalid="true"],.request-form input[type="text"][aria-invalid="true"]{
  border-color:var(--k-secondary);box-shadow:0 0 0 3px rgba(200,16,46,.12)}
.request-hint{display:flex;justify-content:space-between;gap:12px;margin:7px 0 18px;
  font-size:.78rem;color:var(--k-muted-faint)}
.request-count{font-family:'JetBrains Mono',ui-monospace,monospace}
.request-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.request-feedback{margin:14px 0 0;font-size:.88rem;min-height:1.3em}
.request-feedback[data-state="ok"]{color:var(--k-primary)}
.request-feedback[data-state="error"]{color:var(--k-secondary)}
.request-actions{display:flex;gap:12px;align-items:center;margin-top:16px;flex-wrap:wrap}
.request-submit{border:0;border-radius:12px;cursor:pointer;
  background:var(--k-secondary);color:var(--k-on-brand);
  font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;font-weight:700;font-size:.94rem;
  padding:14px 24px;min-height:48px;
  transition:background .2s ease,transform .2s ease,box-shadow .2s ease}
.request-submit:hover{background:var(--k-secondary-700);box-shadow:0 10px 26px rgba(200,16,46,.3)}
.request-submit:active{transform:scale(.98)}
.request-submit:focus-visible{outline:3px solid var(--k-gold);outline-offset:3px}
.request-submit[disabled]{opacity:.6;cursor:progress}
.request-cancel{border:1px solid var(--k-line);background:transparent;color:var(--k-muted);
  border-radius:12px;cursor:pointer;font-family:inherit;font-weight:600;font-size:.9rem;
  padding:13px 20px;min-height:48px;transition:color .2s ease,border-color .2s ease}
.request-cancel:hover{color:var(--k-primary);border-color:var(--k-primary)}
.request-cancel:focus-visible{outline:2px solid var(--k-primary);outline-offset:2px}

@media (max-width:520px){
  .request-panel{padding:0;place-items:end center}
  .request-form{width:100%;border-radius:22px 22px 0 0;max-height:92vh;padding:22px 18px 26px}
}

@media (prefers-reduced-motion:reduce){
  .request-overlay,.request-form{animation:none !important}
  .request-fab,.request-close,.request-submit{transition:none !important}
}

/* ============================================================================
   APPLICATION DETAIL PAGE — visual simplification only.

   Contract, stated because it is the whole point of this block:
     · NO TEXT IS REMOVED. FAQ, changelog and technical requirements keep every word and
       every block; AdSense's sufficient-content requirement (G0.5 / C-14) stays satisfied.
     · The <ins> count does not change: the detail page keeps its two units.
     · Nothing here targets .ad-slot, .ad-section, .ad-spacer or any <ins>. The three ad
       sections are untouched: this block only reaches .app-section, .app-hero and prose.

   What actually changes: roomier sections, one calmer hero, decorative motion switched
   off, and the body face pinned to Inter while metadata keeps its monospace.
   ============================================================================ */
.app-detail-page .app-section{padding:64px 0}
.app-detail-page .app-section h2{letter-spacing:-.02em;margin-bottom:10px}
.app-detail-page .app-section .sec-lead{color:var(--k-muted);line-height:1.7;margin-bottom:32px}

/* A calmer hero: more breathing room, no drifting light behind the title. */
.app-detail-page .app-hero{padding:64px 0 58px}
.app-detail-page .app-hero::before,
.app-detail-page .app-hero::after{animation:none;opacity:.75}
.app-detail-page .app-hero-grid{gap:36px}
.app-detail-page .app-hero h1{line-height:1.08;margin-bottom:10px}
.app-detail-page .app-hero .summary{line-height:1.75}

/* Decorative sweeps are static. They are ornament, not information. */
.app-detail-page .section-divider::after{animation:none}
.app-detail-page .btn-shine::after{display:none}
.app-detail-page .gold-rule{background:linear-gradient(90deg,var(--k-gold),transparent 78%)}

/* Type: Inter for everything a reader reads; JetBrains Mono stays for codes and labels. */
.app-detail-page .prose,
.app-detail-page .prose p,
.app-detail-page .changelog-list li,
.app-detail-page .fact span,
.app-detail-page .app-section p{
  font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;line-height:1.72}
.app-detail-page .fact strong,
.app-detail-page .app-platform,
.app-detail-page .meta-chip .k{font-family:'JetBrains Mono',ui-monospace,monospace}

@media (max-width:760px){
  .app-detail-page .app-section{padding:46px 0}
  .app-detail-page .app-hero{padding:40px 0 38px}
  .app-detail-page .app-hero-grid{gap:22px}
}

@media (prefers-reduced-motion:reduce){
  .app-detail-page .app-hero::before,
  .app-detail-page .app-hero::after,
  .app-detail-page .section-divider::after{animation:none !important}
}
