/* ============================================================
   Aibuddy — Official Website Styles
   AI aesthetic · dark · gradient · glassmorphism
   ============================================================ */

:root {
  --bg: #05060b;
  --bg-soft: #0a0c16;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --text-soft: #c2c8d6;
  --muted: #8b93a7;

  --violet: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --orange: #fb923c;
  --green: #34d399;

  --grad: linear-gradient(120deg, #8b5cf6 0%, #3b82f6 50%, #22d3ee 100%);
  --grad-warm: linear-gradient(120deg, #fb923c 0%, #f43f5e 100%);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --nav-h: 72px;

  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 40px -8px rgba(139, 92, 246, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

html[dir="rtl"] body { direction: rtl; text-align: right; }

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: "Sora", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }

/* ---------- Background canvas + orbs ---------- */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: drift 22s ease-in-out infinite;
}
.orb.a { width: 560px; height: 560px; background: radial-gradient(circle, #7c3aed, transparent 70%); top: -180px; left: -120px; }
.orb.b { width: 480px; height: 480px; background: radial-gradient(circle, #2563eb, transparent 70%); top: 20%; right: -160px; animation-delay: -6s; }
.orb.c { width: 420px; height: 420px; background: radial-gradient(circle, #0ea5e9, transparent 70%); bottom: -140px; left: 30%; animation-delay: -12s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 24px) scale(0.95); }
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }
section { position: relative; z-index: 2; }

.section-pad { padding: 110px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan);
  padding: 7px 16px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  margin-bottom: 22px;
}
.sec-head { max-width: 720px; margin-bottom: 56px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-title { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 18px; }
.sec-sub { color: var(--muted); font-size: 1.06rem; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 28px; border-radius: 14px; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(139, 92, 246, 0.85); }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-strong); border-color: rgba(255,255,255,0.3); }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(4px); }
html[dir="rtl"] .btn:hover .arr { transform: translateX(-4px); }

/* Store badge (Microsoft Store) */
.store-badge { display: inline-flex; align-items: center; transition: transform .2s ease, filter .2s ease; }
.store-badge:hover { transform: translateY(-3px); filter: brightness(1.12) drop-shadow(0 8px 20px rgba(59, 130, 246, 0.28)); }
.store-badge img { display: block; height: 54px; width: auto; }
.store-badge.lg img { height: 66px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 6, 11, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.22rem; letter-spacing: -0.01em; }
.brand-logo {
  width: 36px; height: 36px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(251, 146, 60, 0.4));
}
.brand small { color: var(--muted); font-weight: 500; font-size: 0.78rem; display: block; line-height: 1; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 0.92rem; color: var(--text-soft);
  transition: color .18s ease, background .18s ease;
}
.nav-links a:hover { color: #fff; background: var(--surface); }

.nav-right { display: flex; align-items: center; gap: 12px; }

/* Language selector */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--border-strong); color: var(--text); font-size: 0.88rem; font-weight: 500;
  transition: background .18s ease, border-color .18s ease;
}
.lang-btn:hover { background: var(--surface-strong); border-color: rgba(255,255,255,0.3); }
.lang-btn .globe { width: 16px; height: 16px; color: var(--cyan); }
.lang-btn .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s ease; }
.lang.open .lang-btn .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 190px;
  background: rgba(15, 17, 28, 0.96); backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  max-height: 340px; overflow: auto;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 10px 12px; border-radius: 9px; background: transparent; border: none;
  color: var(--text-soft); font-size: 0.9rem; text-align: start;
  transition: background .14s ease, color .14s ease;
}
.lang-item:hover { background: var(--surface-strong); color: #fff; }
.lang-item.active { color: #fff; background: rgba(139,92,246,0.16); }
.lang-item .tick { color: var(--cyan); width: 16px; height: 16px; opacity: 0; }
.lang-item.active .tick { opacity: 1; }

.hamburger { display: none; width: 44px; height: 44px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.hamburger svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--nav-h) + 84px) 0 70px; position: relative; z-index: 2; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-copy .badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 999px; font-size: 0.84rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-soft);
  margin-bottom: 26px;
}
.hero-copy .badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); animation: pulse 2.2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(52,211,153,0.18);} 50% { box-shadow: 0 0 0 8px rgba(52,211,153,0.05);} }

.hero-copy h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.1rem); margin-bottom: 24px; letter-spacing: -0.03em;
}
.hero-copy p.lead { color: var(--text-soft); font-size: 1.14rem; max-width: 520px; margin-bottom: 34px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.hero-note svg { width: 17px; height: 17px; color: var(--green); }

/* Hero visual */
.hero-visual { position: relative; }
.hero-frame {
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-14px);} }
.hero-frame .bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border);
}
.hero-frame .bar span { width: 11px; height: 11px; border-radius: 50%; }
.hero-frame .bar span:nth-child(1){ background:#ff5f57;} .hero-frame .bar span:nth-child(2){ background:#febc2e;} .hero-frame .bar span:nth-child(3){ background:#28c840;}
.hero-frame .bar .url {
  margin-inline-start: 8px; font-size: 0.76rem; color: var(--muted);
  background: rgba(255,255,255,0.05); padding: 4px 12px; border-radius: 8px;
}
.hero-frame img { width: 100%; height: auto; }

.float-chip {
  position: absolute; display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 13px; font-size: 0.84rem; font-weight: 600;
  background: rgba(18, 20, 32, 0.9); border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
  animation: floaty 6s ease-in-out infinite;
}
.float-chip .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.float-chip .ic svg { width: 15px; height: 15px; }
.chip-1 { top: -20px; inset-inline-start: -18px; animation-delay: -2s; }
.chip-1 .ic { background: rgba(139,92,246,0.2); color: #a78bfa; }
.chip-2 { bottom: 60px; inset-inline-end: -22px; animation-delay: -4s; }
.chip-2 .ic { background: rgba(34,211,238,0.18); color: var(--cyan); }
.chip-3 { bottom: -22px; inset-inline-start: 40px; animation-delay: -1s; }
.chip-3 .ic { background: rgba(251,146,60,0.18); color: var(--orange); }

/* ---------- Stats strip ---------- */
.stats { border-block: 1px solid var(--border); background: rgba(255,255,255,0.015); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px 0; }
.stat { text-align: center; }
.stat .val { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat .lbl { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.stat + .stat { border-inline-start: 1px solid var(--border); }

/* ---------- Features ---------- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  position: relative; padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.feature:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-strong); }
.feature::before {
  content: ""; position: absolute; top: -40%; inset-inline-end: -30%; width: 200px; height: 200px;
  background: radial-gradient(circle, var(--fc, rgba(139,92,246,0.25)), transparent 70%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.feature:hover::before { opacity: 1; }
.f-ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--fi, rgba(139,92,246,0.15)); color: var(--fc, #a78bfa);
  border: 1px solid rgba(255,255,255,0.08);
}
.f-ic svg { width: 26px; height: 26px; }
.feature h3 { font-size: 1.18rem; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Models ---------- */
.models { background: linear-gradient(180deg, rgba(139,92,246,0.05), transparent 60%); }
.models-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.model-card {
  display: flex; align-items: center; gap: 13px; padding: 20px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .22s ease, border-color .22s ease;
}
.model-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.model-card .mlogo {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; color: #fff;
}
.model-card .mname { font-weight: 600; font-size: 0.98rem; }
.model-card .msub { color: var(--muted); font-size: 0.8rem; }

/* ---------- Workflow ---------- */
.workflow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step {
  position: relative; padding: 30px 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.step .num {
  font-size: 0.8rem; font-weight: 700; color: var(--cyan);
  letter-spacing: 0.12em; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.step .num::before {
  content: "0" counter(step); counter-increment: step;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(34,211,238,0.12); color: var(--cyan); font-size: 0.9rem;
}
.step h3 { font-size: 1.12rem; margin-bottom: 9px; }
.step p { color: var(--muted); font-size: 0.93rem; }
.step .line { position: absolute; top: 46px; inset-inline-end: -16px; width: 20px; height: 1px; background: var(--border-strong); }
.step:last-child .line { display: none; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.shot {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.shot:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.shot .imgwrap { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #0a0c16; }
.shot .imgwrap img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s ease; }
.shot:hover .imgwrap img { transform: scale(1.045); }
.shot .cap {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px;
  font-weight: 600; font-size: 0.98rem;
}
.shot .cap svg { width: 18px; height: 18px; color: var(--cyan); flex-shrink: 0; }

/* ---------- Privacy ---------- */
.privacy { background: linear-gradient(180deg, transparent, rgba(34,211,238,0.05) 100%); }
.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pcard {
  padding: 32px 28px; border-radius: var(--radius); text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s ease, border-color .25s ease;
}
.pcard:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.pcard .ic {
  width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 18px; display: grid; place-items: center;
  background: rgba(34,211,238,0.12); color: var(--cyan);
}
.pcard .ic svg { width: 28px; height: 28px; }
.pcard h3 { font-size: 1.14rem; margin-bottom: 10px; }
.pcard p { color: var(--muted); font-size: 0.94rem; }

/* ---------- CTA ---------- */
.cta-box {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 32px; padding: 84px 40px;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(59,130,246,0.14), rgba(34,211,238,0.12));
  border: 1px solid var(--border-strong);
}
.cta-box::before {
  content: ""; position: absolute; inset: -40%; z-index: 0;
  background: conic-gradient(from 0deg, transparent, rgba(139,92,246,0.25), transparent 30%);
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta-box > * { position: relative; z-index: 1; }
.cta-box h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 16px; }
.cta-box p { color: var(--text-soft); max-width: 560px; margin: 0 auto 34px; font-size: 1.08rem; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; background: rgba(255,255,255,0.01); }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand { max-width: 340px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--muted); font-size: 0.94rem; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-soft); font-size: 0.94rem; margin-bottom: 11px; transition: color .16s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.86rem;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy p.lead { max-width: 640px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-grid { grid-template-columns: repeat(2, 1fr); }
  .step .line { display: none; }
  .models-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .section-pad { padding: 76px 0; }
  .nav-links { display: none; }
  .hamburger { display: grid; place-items: center; }
  .features-grid { grid-template-columns: 1fr; }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .privacy-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 18px; }
  .stat + .stat { border-inline-start: none; border-top: 1px solid var(--border); padding-top: 18px; }
  .cta-box { padding: 60px 22px; }
  .hero { padding-top: calc(var(--nav-h) + 54px); }
  .float-chip { padding: 9px 12px; font-size: 0.78rem; }
  .chip-2 { inset-inline-end: -6px; }
  .chip-1 { inset-inline-start: -6px; }
  .nav .btn-primary { display: none; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 49;
  background: rgba(8, 10, 18, 0.98); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px 26px; display: none; flex-direction: column; gap: 4px;
  transform: translateY(-8px); opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.mobile-menu.open { display: flex; transform: translateY(0); opacity: 1; }
.mobile-menu a { padding: 14px 6px; font-size: 1.05rem; color: var(--text); border-bottom: 1px solid var(--border); }
.mobile-menu .btn { margin-top: 16px; }
