/* ============================================================
   PINGOU — polish layer (home page)
   Additive only: loaded after every other stylesheet.
   ============================================================ */

::selection { background: rgba(91, 46, 255, 0.22); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 150;
  pointer-events: none;
  transform: scaleX(var(--sp, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--mint), var(--violet) 55%, #ff8a1f);
}
html[dir="rtl"] .scroll-progress { transform-origin: 100% 50%; }

.site-header { transition: box-shadow 0.4s var(--ease), background 0.3s; }
.site-header.is-scrolled { box-shadow: 0 12px 40px rgba(24, 20, 70, 0.08); }

/* ---------- hero ---------- */
.hero-aurora {
  position: absolute;
  inset: -10% -5% 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.hero-aurora i:nth-child(1) { width: 520px; height: 520px; top: -8%; right: 6%; background: rgba(91, 46, 255, 0.26); animation: aurora-a 18s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(2) { width: 440px; height: 440px; bottom: -6%; right: 28%; background: rgba(255, 46, 147, 0.20); animation: aurora-b 22s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(3) { width: 360px; height: 360px; top: 22%; left: -6%; background: rgba(0, 184, 217, 0.20); animation: aurora-a 26s ease-in-out infinite alternate-reverse; }
@keyframes aurora-a { to { transform: translate3d(-70px, 50px, 0) scale(1.15); } }
@keyframes aurora-b { to { transform: translate3d(80px, -40px, 0) scale(0.9); } }

/* Entrance animations only run once polish.js has seen a real animation frame
   (html.fx-ready), so the hero is never left invisible where frames are not produced. */
html.fx-ready .hero h1 .line { animation: hero-rise 0.95s var(--ease-out) both; }
html.fx-ready .hero h1 .line:nth-child(2) { animation-delay: 0.09s; }
html.fx-ready .hero h1 .line:nth-child(3) { animation-delay: 0.18s; }
html.fx-ready .hero .hero-sub { animation: hero-rise 0.95s var(--ease-out) 0.28s both; }
html.fx-ready .hero .hero-actions { animation: hero-rise 0.95s var(--ease-out) 0.38s both; }
html.fx-ready .hero .hero-price { animation: hero-rise 0.95s var(--ease-out) 0.48s both; }
html.fx-ready .hero .hero-visual { animation: hero-pop 1.2s var(--ease-out) 0.2s both; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes hero-pop { from { opacity: 0; transform: translateY(30px) scale(0.96); } }

.hero .grad-text {
  background-image: linear-gradient(100deg, var(--mint) 0%, var(--violet) 38%, #ff8a1f 68%, var(--mint) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: grad-shift 8s ease-in-out 1s infinite alternate;
}
html.fx-ready .hero .grad-text { animation: hero-rise 0.95s var(--ease-out) 0.09s both, grad-shift 8s ease-in-out 1s infinite alternate; }
@keyframes grad-shift { to { background-position: 100% 0; } }

@media (min-width: 1180px) {
  .hero-visual .browser-card { width: 520px; }
}
.hero-visual .browser-card { box-shadow: 0 50px 110px rgba(15, 20, 26, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 0 120px rgba(91, 46, 255, 0.16); }

.hero-dot.is-active { width: 34px; position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.28); }
.hero-dot.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #5df2c5;
  transform-origin: 0 50%;
  animation: dot-fill 4.6s linear both;
}
@keyframes dot-fill { from { transform: scaleX(0); } }

.hero-caption {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(24, 20, 70, 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 13px;
  white-space: nowrap;
  color: var(--text);
  direction: ltr;
}
.hero-caption b { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.hero-caption .hc-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
}
.hero-caption .hc-live::before,
.spot-live .dot {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(116, 80, 255, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(116, 80, 255, 0); }
}
@media (max-width: 1100px) { .hero-caption { bottom: 0; } }
@media (max-width: 700px) { .hero-caption { bottom: -6px; font-size: 12px; padding: 7px 13px 7px 10px; } }

/* ---------- buttons ---------- */
.btn--primary { overflow: hidden; isolation: isolate; }
.btn--primary::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 45%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s var(--ease);
  pointer-events: none;
}
.btn--primary:hover::before { left: 120%; }
.btn:active { transform: translateY(0) scale(0.98); }

/* ---------- cursor-follow glow on cards ---------- */
.glow-fx {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(116, 80, 255, 0.13), transparent 62%);
}
:hover > .glow-fx { opacity: 1; }
.service-card:hover, .process-step:hover, .plan-card:hover { box-shadow: 0 26px 60px rgba(24, 20, 70, 0.10); }

/* ---------- stats ---------- */
.stat { transition: transform 0.45s var(--ease); }
.stat:hover { transform: translateY(-4px); }
.stat .s-val { transition: color 0.3s; }
.stat:hover .s-val { color: var(--mint); }

/* ---------- featured launch (spotlight) ---------- */
.spotlight-slot { margin-bottom: 30px; }
.spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: clamp(22px, 3.4vw, 52px);
  align-items: center;
  padding: clamp(16px, 2vw, 26px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(70% 90% at 8% 0%, rgba(226, 189, 122, 0.20), transparent 60%),
    radial-gradient(60% 80% at 100% 100%, rgba(116, 80, 255, 0.20), transparent 62%),
    #10151b;
  box-shadow: 0 40px 100px rgba(15, 20, 26, 0.28);
  overflow: hidden;
}
.spot-media { position: relative; display: block; border-radius: 18px; }
.spot-browser {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0e13;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}
.spot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  direction: ltr;
}
.spot-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.spot-url {
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: #cfc8ba;
}
.spot-url .icon { width: 9px; height: 9px; color: #6bf5c8; }
.spot-browser img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.1s var(--ease);
}
.spot-media:hover .spot-browser { transform: translateY(-6px); box-shadow: 0 44px 90px rgba(0, 0, 0, 0.6); }
.spot-media:hover img { transform: scale(1.035); }
.spot-visit {
  position: absolute;
  right: 16px; bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #151a20;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.45s var(--ease);
}
.spot-visit .icon { width: 14px; height: 14px; }
.spot-media:hover .spot-visit, .spot-media:focus-visible .spot-visit { opacity: 1; transform: none; }

.spot-body { padding: clamp(6px, 1.4vw, 18px) clamp(4px, 1.4vw, 20px) clamp(8px, 1.4vw, 18px) 0; min-width: 0; }
html[dir="rtl"] .spot-body { padding-right: clamp(4px, 1.4vw, 20px); padding-left: 0; }
.spot-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 20px; }
.spot-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(107, 245, 200, 0.32);
  background: rgba(107, 245, 200, 0.08);
  color: #6bf5c8;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.spot-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sp-accent, #e2bd7a);
}
html.lang-ar .spot-live, html.lang-ar .spot-kicker { letter-spacing: 0; font-size: 12px; }
.spotlight h3 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.1vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #f8f4ea;
}
.spot-tagline {
  margin-top: 12px;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.45;
  color: var(--sp-accent, #e2bd7a);
}
.spot-summary { margin-top: 14px; font-size: 1rem; line-height: 1.7; color: #cfc8ba; max-width: 52ch; }
.spot-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.spot-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #f8f4ea;
}
.spot-stat span { display: block; margin-top: 6px; font-size: 0.8125rem; line-height: 1.4; color: #a49c8e; }
.spot-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.spot-actions .btn { height: 48px; }

@media (max-width: 960px) {
  .spotlight { grid-template-columns: 1fr; }
  .spot-body { padding: 4px 8px 12px; }
  html[dir="rtl"] .spot-body { padding: 4px 8px 12px; }
  .spot-visit { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
  .spotlight { padding: 12px; border-radius: 22px; }
  .spot-stats { gap: 10px; }
  .spot-actions .btn { flex: 1 1 100%; }
  .spot-visit { right: 10px; bottom: 10px; padding: 8px 13px; font-size: 12px; }
}

/* ---------- project cards ---------- */
.project-card .project-media { transition: border-color 0.4s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.project-card:hover .project-media { box-shadow: 0 30px 70px rgba(24, 20, 70, 0.18); }
.project-shot img { transition: transform 0.9s var(--ease); }
.project-card:hover .project-shot img { transform: scale(1.05); }

/* ---------- sticky mobile CTA ---------- */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta:not([hidden]) {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 8px 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(24, 20, 70, 0.22);
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.5s var(--ease-out), opacity 0.3s;
  }
  html[dir="rtl"] .sticky-cta:not([hidden]) { padding: 8px 18px 8px 8px; }
  .sticky-cta.is-on:not([hidden]) { transform: none; opacity: 1; }
  .sticky-cta-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
  .sticky-cta-price small { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--muted); letter-spacing: 0.05em; }
  .sticky-cta .btn { height: 46px; padding: 0 20px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora i, html.fx-ready .hero h1 .line, html.fx-ready .hero .grad-text, .hero .grad-text,
  html.fx-ready .hero .hero-sub, html.fx-ready .hero .hero-actions,
  html.fx-ready .hero .hero-price, html.fx-ready .hero .hero-visual, .hero-dot.is-active::after,
  .hero-caption .hc-live::before, .spot-live .dot { animation: none; }
  .btn--primary::before { display: none; }
  .sticky-cta:not([hidden]) { transition: none; }
}

/* ---------- animated background: floating project glyphs ---------- */
.fx-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 88% 8%, rgba(91, 46, 255, 0.10), transparent 70%),
    radial-gradient(50% 45% at 6% 38%, rgba(255, 46, 147, 0.08), transparent 70%),
    radial-gradient(55% 50% at 70% 96%, rgba(0, 184, 217, 0.09), transparent 70%);
}
.fx-glyph {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 34px);
  height: var(--s, 34px);
  color: var(--c, #5b2eff);
  opacity: var(--o, 0.34);
  animation: fx-drift var(--t, 16s) ease-in-out var(--dl, 0s) infinite alternate;
  will-change: transform;
}
.fx-glyph svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fx-drift {
  0% { transform: translate3d(0, 0, 0) rotate(var(--r0, -8deg)); }
  50% { transform: translate3d(var(--dx, 18px), calc(var(--dy, -34px) * 0.55), 0) rotate(calc(var(--r1, 10deg) * 0.4)); }
  100% { transform: translate3d(calc(var(--dx, 18px) * -0.6), var(--dy, -34px), 0) rotate(var(--r1, 10deg)); }
}
@media (max-width: 760px) {
  .fx-glyph { opacity: calc(var(--o, 0.34) * 0.6); width: calc(var(--s, 34px) * 0.8); height: calc(var(--s, 34px) * 0.8); }
  .fx-glyph:nth-child(n+11) { display: none; }
}

/* ---------- hero: project chips orbiting the browser card ---------- */
.fx-chip {
  position: absolute;
  z-index: 3;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px 9px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 18, 48, 0.08);
  box-shadow: 0 18px 44px rgba(24, 20, 70, 0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0e1033;
  white-space: nowrap;
  direction: ltr;
  animation: fx-bob var(--t, 6s) ease-in-out var(--dl, 0s) infinite alternate;
}
.fx-chip i {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--c, #5b2eff);
  color: #fff;
}
.fx-chip i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fx-bob {
  from { transform: translate3d(0, 0, 0) rotate(var(--r0, -3deg)); }
  to { transform: translate3d(var(--dx, 6px), var(--dy, -16px), 0) rotate(var(--r1, 3deg)); }
}
@media (max-width: 1100px) {
  .fx-chip { font-size: 10px; padding: 7px 10px 7px 7px; border-radius: 13px; }
  .fx-chip i { width: 24px; height: 24px; border-radius: 8px; }
  .fx-chip i svg { width: 13px; height: 13px; }
}
@media (max-width: 700px) {
  .fx-chip:nth-of-type(n+4) { display: none; }
  .fx-chip b { display: none; }
  .fx-chip { padding: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-glyph, .fx-chip { animation: none; }
}
