/* ═══════════════════════════════════════════════════════════
   polish.css — additive "premium feel" layer (hover + tiny motion
   + page transitions). Safe to remove: delete this file and
   polish.js and their <link>/<script> tags.
   All selectors use :where() => specificity 0, so every existing
   rule in main.css / ajvika.css / page CSS still wins.
   ═══════════════════════════════════════════════════════════ */

:root{
  --pl-ease: cubic-bezier(.22,.61,.36,1);
  --pl-fast: .22s;
  --pl-med: .35s;
}

/* ── Page transition (modern browsers: cross-document) ── */
@media (prefers-reduced-motion: no-preference){
  @view-transition{ navigation: auto; }
  ::view-transition-old(root){ animation: pl-out .18s ease both; }
  ::view-transition-new(root){ animation: pl-in .38s var(--pl-ease) both; }

  /* Fallback fade/slide-in for browsers without view transitions */
  html.pl-ready body{ animation: pl-in .45s var(--pl-ease) both; }
  html.pl-leaving body{ opacity:0; transform:none; transition: opacity .18s ease; }
}
@keyframes pl-in { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }
@keyframes pl-out{ from{opacity:1} to{opacity:0} }

/* ── Links: animated underline for inline text links ── */
:where(p, li, .desc, .faq-content) > a:not([class]){
  text-decoration: none;
  background: linear-gradient(currentColor,currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--pl-med) var(--pl-ease);
}
:where(p, li, .desc, .faq-content) > a:not([class]):hover{ background-size: 100% 1px; }

/* ── Buttons: lift + soft glow + press ── */
:where(.btn, .btn-primary, .btn-ghost, .btn-outline-ajvika, .btn-view-all-apps, .apc-btn,
       .apc-play-btn, .ceo-btn, .ceo-btn-ghost, .ceo-btn-primary, .hw-cta-btn,
       .send-btn, .subscribe-btn, .btn-get-started, .btn-getstarted, .play-store-btn, .play-badge){
  transition: transform var(--pl-fast) var(--pl-ease), box-shadow var(--pl-fast) var(--pl-ease),
              background-color var(--pl-fast), border-color var(--pl-fast), color var(--pl-fast), filter var(--pl-fast);
  will-change: transform;
}
:where(.btn, .btn-primary, .btn-ghost, .btn-outline-ajvika, .btn-view-all-apps, .apc-btn,
       .apc-play-btn, .ceo-btn, .ceo-btn-ghost, .ceo-btn-primary, .hw-cta-btn,
       .send-btn, .subscribe-btn, .btn-get-started, .btn-getstarted, .play-store-btn, .play-badge):hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(2,200,245,.55);
}
:where(.btn, .btn-primary, .btn-ghost, .btn-outline-ajvika, .btn-view-all-apps, .apc-btn,
       .apc-play-btn, .ceo-btn, .ceo-btn-ghost, .ceo-btn-primary, .hw-cta-btn,
       .send-btn, .subscribe-btn, .btn-get-started, .btn-getstarted, .play-store-btn, .play-badge):active{
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

/* ── Cards: gentle lift ── */
:where(.ajvika-platform-card, .app-download-card, .app-coming-card, .ceo-news-card,
       .ceo-journey-card, .contact-card, .card, .platform-chip, .chip, .faq-item){
  transition: transform var(--pl-med) var(--pl-ease), box-shadow var(--pl-med) var(--pl-ease),
              border-color var(--pl-med), background-color var(--pl-med);
}
:where(.ajvika-platform-card, .app-download-card, .app-coming-card, .ceo-news-card,
       .ceo-journey-card, .platform-chip, .chip):hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 38px -22px rgba(0,0,0,.45);
}
:where(.faq-item):hover{ transform: translateX(3px); }

/* ── Icons: tiny pop when card is hovered ── */
:where(.apc-icon, .app-dl-icon, .app-coming-icon, .ceo-skill-icon, .ceo-inv-icon,
       .hw-intro-icon, .hw-lineup-icon, .glyph){
  transition: transform var(--pl-med) var(--pl-ease);
}
:where(.ajvika-platform-card, .app-download-card, .app-coming-card, .card, .ceo-journey-card):hover
:where(.apc-icon, .app-dl-icon, .app-coming-icon, .glyph, .ceo-skill-icon){
  transform: scale(1.08) rotate(-3deg);
}

/* ── Images in galleries / portfolio: slow zoom inside frame ── */
:where(.portfolio-item){
  overflow: hidden;
}
:where(.portfolio-item img, .ceo-news-card-img img, .ceo-journey-img img, .ceo-news-gallery a img){
  transition: transform .6s var(--pl-ease);
}
:where(.portfolio-item, .ceo-news-card-img, .ceo-journey-img, .ceo-news-gallery a):hover
:where(img){
  transform: scale(1.05);
}

/* ── Social / footer icons ── */
:where(.social-links a, .social-icons_c a){
  transition: transform var(--pl-fast) var(--pl-ease), background-color var(--pl-fast), color var(--pl-fast);
}
:where(.social-links a, .social-icons_c a):hover{ transform: translateY(-3px); }
:where(.footer-links ul a, footer .col a){
  transition: transform var(--pl-fast) var(--pl-ease), color var(--pl-fast);
}
:where(.footer-links ul a, footer .col a):hover{ transform: translateX(3px); }

/* ── Nav links: underline slide ── */
:where(.navmenu > ul > li > a, .topbar nav a:not(.back)){
  background: linear-gradient(currentColor,currentColor) 0 calc(100% - 4px) / 0 2px no-repeat;
  transition: background-size var(--pl-med) var(--pl-ease), color var(--pl-fast);
}
:where(.navmenu > ul > li > a, .topbar nav a:not(.back)):hover{ background-size: 100% 2px; }

/* ── Form fields: soft focus ring ── */
:where(input, textarea, select){ transition: box-shadow var(--pl-fast), border-color var(--pl-fast); }
:where(input, textarea, select):focus{ box-shadow: 0 0 0 3px rgba(2,200,245,.18); }

/* ── Scroll reveal (opt-in via polish.js; only hides once JS has run) ── */
@media (prefers-reduced-motion: no-preference){
  html.pl-js .pl-reveal{ opacity:0; transform:translateY(14px);
    transition: opacity .6s var(--pl-ease), transform .6s var(--pl-ease);
    transition-delay: var(--pl-d, 0s); }
  html.pl-js .pl-reveal.pl-in{ opacity:1; transform:none; }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ═══ Extras ═══ */

/* Smooth anchor scrolling */
@media (prefers-reduced-motion: no-preference){ html{ scroll-behavior: smooth; } }

/* Brand text-selection colour */
::selection{ background: rgba(2,200,245,.28); }

/* Clear keyboard focus ring (only for keyboard users) */
:where(a, button, [role="button"], summary):focus-visible{
  outline: 2px solid rgba(2,200,245,.8); outline-offset: 3px; border-radius: 6px;
}

/* Thin scroll-progress bar at very top */
#pl-progress{
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #02c8f5, #4dd8ff);
  z-index: 100000; pointer-events: none; opacity: 0;
  transition: opacity .25s ease;
}
#pl-progress.on{ opacity: 1; }

/* Images fade in once loaded (only those JS marks as pending) */
img.pl-img{ opacity: 0; transition: opacity .5s var(--pl-ease); }
img.pl-img.pl-loaded{ opacity: 1; }

/* Back-to-top button: softer pop */
:where(#scroll-top, .scroll-top){ transition: transform var(--pl-fast) var(--pl-ease), opacity .3s, visibility .3s, background-color .3s; }
:where(#scroll-top, .scroll-top):hover{ transform: translateY(-3px); }

@media print{ #pl-progress{ display:none } }

/* ═══ Extras 2: hero reveal · button shine · card tilt · header shadow · counters ═══ */

/* Hero text reveal (home page). 'backwards' fill so hover transforms still work afterwards */
@media (prefers-reduced-motion: no-preference){
  .hero .container h1,
  .hero .container p,
  .hero .container .btn-get-started{
    animation: pl-rise .7s var(--pl-ease) backwards;
  }
  .hero .container h1{ animation-delay: .10s; }
  .hero .container p:nth-of-type(1){ animation-delay: .22s; }
  .hero .container p:nth-of-type(2){ animation-delay: .32s; }
  .hero .container .btn-get-started:nth-of-type(1){ animation-delay: .44s; }
  .hero .container .btn-get-started:nth-of-type(2){ animation-delay: .52s; }
}
@keyframes pl-rise{ from{ opacity:0; transform:translateY(16px);} to{ opacity:1; transform:none;} }

/* Button shine sweep on hover */
@media (hover:hover) and (prefers-reduced-motion: no-preference){
  :where(.btn-get-started, .ceo-btn-primary, .btn-primary, .hw-cta-btn){
    position: relative; overflow: hidden; isolation: isolate;
  }
  :where(.btn-get-started, .ceo-btn-primary, .btn-primary, .hw-cta-btn)::after{
    content:""; position:absolute; top:0; left:-60%; width:40%; height:100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg); pointer-events:none; z-index:-1;
    transition: left .6s var(--pl-ease);
  }
  :where(.btn-get-started, .ceo-btn-primary, .btn-primary, .hw-cta-btn):hover::after{ left:130%; }
}

/* Card tilt toward mouse (desktop mouse only; JS sets --rx / --ry) */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion: no-preference){
  :where(.ajvika-platform-card, .app-download-card, .app-coming-card):hover{
    transform: perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-4px);
  }
}

/* Header gets a soft shadow once the page is scrolled */
html.pl-scrolled #header{ box-shadow: 0 8px 24px -14px rgba(0,0,0,.45); }

/* ═══ Floating WhatsApp button ═══ */
.pl-wa{
  position: fixed; left: 16px; bottom: 16px; z-index: 9990;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: #25d366; color: #fff;
  box-shadow: 0 8px 22px -6px rgba(0,0,0,.45);
  transition: transform var(--pl-fast) var(--pl-ease), box-shadow var(--pl-fast);
  text-decoration: none;
}
.pl-wa svg{ width: 28px; height: 28px; fill: currentColor; }
.pl-wa:hover{ transform: translateY(-3px) scale(1.06); box-shadow: 0 14px 28px -8px rgba(0,0,0,.5); color:#fff; }
@media (prefers-reduced-motion: no-preference){
  .pl-wa::after{ content:""; position:absolute; inset:0; border-radius:50%;
    box-shadow: 0 0 0 0 rgba(37,211,102,.55); animation: pl-wa-pulse 2.6s infinite; pointer-events:none; }
}
@keyframes pl-wa-pulse{ 0%{box-shadow:0 0 0 0 rgba(37,211,102,.5)} 70%{box-shadow:0 0 0 14px rgba(37,211,102,0)} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0)} }
@media print{ .pl-wa{ display:none } }
