/* ============================================================
   Joyina landing page — shared styles (AR + EN)
   Works together with Tailwind CDN. Everything here is either an
   animation, an effect, or a layout helper Tailwind can't express.
   ============================================================ */

:root {
  --brand: #7c3aed;
  --brand-2: #2563eb;
  --brand-3: #06b6d4;
  --navy: #0b1230;
  --navy-2: #111a3d;
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* ---------- Scroll progress bar ---------- */
.progress-bar {
  position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  z-index: 100; transition: width .1s linear;
}

/* ---------- Navbar ---------- */
.nav-glass {
  background: rgba(11, 18, 48, .35);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .3s, box-shadow .3s, padding .3s;
}
.nav-glass.scrolled {
  background: rgba(255,255,255,.92);
  border-bottom-color: rgba(15,23,42,.08);
  box-shadow: 0 10px 30px -15px rgba(15,23,42,.25);
}
.nav-glass .nav-link { color: rgba(255,255,255,.85); }
.nav-glass.scrolled .nav-link { color: #334155; }
.nav-glass .nav-link:hover, .nav-glass.scrolled .nav-link:hover { color: var(--brand); }
.nav-glass .nav-logo-dark { display: none; }
.nav-glass.scrolled .nav-logo-light { display: none; }
.nav-glass.scrolled .nav-logo-dark { display: block; }
.nav-glass .nav-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.nav-glass.scrolled .nav-ghost { color: #0f172a; border-color: rgba(15,23,42,.15); }
.nav-glass .nav-burger { color: #fff; }
.nav-glass.scrolled .nav-burger { color: #0f172a; }
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--brand); transition: width .25s;
}
.nav-link:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(37,99,235,.35), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(6,182,212,.25), transparent 60%),
    var(--navy);
}
.hero-grid {
  position: absolute; inset: 0; opacity: .25;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.blob {
  position: absolute; border-radius: 9999px; filter: blur(70px); opacity: .55;
  animation: blob 14s ease-in-out infinite; will-change: transform;
}
@keyframes blob {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-60px) scale(1.12); }
  66% { transform: translate(-30px,30px) scale(.92); }
}

.gradient-text {
  background: linear-gradient(90deg, #c4b5fd, #60a5fa, #22d3ee, #c4b5fd);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-shift 6s linear infinite;
}
.gradient-text-dark {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #0891b2, #7c3aed);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-shift 6s linear infinite;
}
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }

.typed-cursor {
  display: inline-block; width: 3px; height: .9em; margin-inline-start: 4px;
  background: #a78bfa; vertical-align: -0.1em; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-frame {
  position: relative; border-radius: 28px; padding: 10px;
  background: linear-gradient(135deg, rgba(167,139,250,.6), rgba(96,165,250,.25), rgba(34,211,238,.5));
  box-shadow: 0 40px 80px -30px rgba(124,58,237,.6), 0 0 0 1px rgba(255,255,255,.06) inset;
  animation: float 7s ease-in-out infinite;
}
.hero-frame img { border-radius: 20px; display: block; width: 100%; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.chip {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.95); color: #0f172a; border-radius: 14px;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,.5);
  animation: chip-float 6s ease-in-out infinite;
}
.chip .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 15px; }
.chip-1 { top: 8%; inset-inline-start: -6%; animation-delay: .2s; }
.chip-2 { bottom: 16%; inset-inline-end: -8%; animation-delay: 1.4s; }
.chip-3 { bottom: -4%; inset-inline-start: 10%; animation-delay: 2.6s; }
@keyframes chip-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(-1deg); } }
@media (max-width: 1023px) { .chip-1 { inset-inline-start: 2%; } .chip-2 { inset-inline-end: 2%; } }
@media (max-width: 640px) { .chip { font-size: 11px; padding: 8px 10px; } .chip-3 { display: none; } }

.pulse-ring { position: relative; }
.pulse-ring::before {
  content: ""; position: absolute; inset: -4px; border-radius: 9999px;
  border: 2px solid rgba(52,211,153,.7); animation: ring 1.8s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 3rem; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-direction: reverse; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.65,.3,1), transform .7s cubic-bezier(.2,.65,.3,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(.92); }
.reveal.in.reveal-left, .reveal.in.reveal-right, .reveal.in.reveal-scale { transform: none; }

/* ---------- Cards ---------- */
.card-glow { position: relative; overflow: hidden; }
.card-glow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(124,58,237,.14), transparent 45%);
}
.card-glow:hover::before { opacity: 1; }
.card-glow.dark::before { background: radial-gradient(500px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.12), transparent 45%); }

.tilt { transform-style: preserve-3d; transition: transform .15s ease-out, box-shadow .3s; will-change: transform; }
.tilt > * { transform: translateZ(20px); }

.icon-bounce { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.group:hover .icon-bounce { transform: translateY(-4px) scale(1.1) rotate(-4deg); }

.shine { position: relative; overflow: hidden; }
.shine::after {
  content: ""; position: absolute; top: -50%; inset-inline-start: -60%; width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: inset-inline-start .6s;
}
.shine:hover::after { inset-inline-start: 130%; }

/* ---------- Product cards ---------- */
.product-logo { max-height: 72px; width: auto; object-fit: contain; transition: transform .4s; }
.group:hover .product-logo { transform: scale(1.06); }
.badge-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 28px; inset-inline: 10%; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  opacity: .35;
}
@media (max-width: 767px) { .timeline::before { display: none; } }
.timeline-step .num {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  font-weight: 900; font-size: 20px; color: #fff; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px -10px rgba(124,58,237,.7); position: relative; z-index: 1;
  transition: transform .3s;
}
.timeline-step:hover .num { transform: scale(1.1) rotate(-6deg); }

/* ---------- Counters ---------- */
.stat { font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; transition: box-shadow .3s, border-color .3s; }
.faq-item.open { border-color: #c4b5fd; box-shadow: 0 20px 40px -25px rgba(124,58,237,.5); }
.faq-item button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; text-align: start; font-weight: 800; color: #0f172a; }
.faq-item .faq-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f1f5f9; color: var(--brand); transition: transform .3s, background .3s, color .3s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--brand); color: #fff; }
.faq-body { max-height: 0; overflow: hidden; transition: max-height .4s ease, padding .3s; padding: 0 24px; color: #475569; line-height: 1.8; }
.faq-item.open .faq-body { padding: 0 24px 22px; }

/* ---------- Floating controls ---------- */
.fab-wa {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 60;
  width: 60px; height: 60px; border-radius: 9999px; display: grid; place-items: center;
  background: #25d366; color: #fff; font-size: 30px;
  box-shadow: 0 20px 40px -12px rgba(37,211,102,.7);
  transition: transform .3s;
}
.fab-wa:hover { transform: scale(1.08) rotate(6deg); }
.fab-wa::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid rgba(37,211,102,.6); animation: ring 2s ease-out infinite; }
.to-top {
  position: fixed; bottom: 96px; inset-inline-end: 30px; z-index: 60;
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: #0f172a; color: #fff; opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .3s, transform .3s; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Mobile menu ---------- */
.mobile-menu { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.mobile-menu.open { max-height: 480px; }

/* ---------- Section divider ---------- */
.section-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.section-tag::before { content: ""; width: 24px; height: 2px; background: var(--brand); border-radius: 2px; }

/* ---------- Contact ---------- */
.input {
  width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px 14px;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,58,237,.12); background: #fff; }
.btn-primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800;
  box-shadow: 0 16px 30px -12px rgba(124,58,237,.7); transition: transform .25s, box-shadow .25s, filter .25s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -14px rgba(124,58,237,.8); filter: brightness(1.05); }
.btn-primary:disabled { opacity: .7; transform: none; cursor: wait; }

.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translate(-50%, 20px); z-index: 90;
  background: #0f172a; color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  max-width: 92vw; text-align: center;
}
[dir="rtl"] .toast { transform: translate(50%, 20px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[dir="rtl"] .toast.show { transform: translate(50%, 0); }
.toast.ok { background: #059669; } .toast.err { background: #dc2626; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
