/* ============================================================
   ROBEXIA — design system
   Deep navy · electric cyan · chrome · minimal-tech, lots of air
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* backgrounds */
  --bg:          #05080d;
  --bg-2:        #080c13;
  --surface:     #0c121b;
  --surface-2:   #111a26;
  --surface-3:   #16212f;

  /* lines */
  --line:        rgba(120,150,170,0.10);
  --line-2:      rgba(130,170,190,0.18);
  --line-cyan:   rgba(47,215,240,0.30);

  /* text */
  --text:        #e8eff5;
  --text-dim:    #9aa9b7;
  --text-mute:   #5a6776;

  /* brand */
  --cyan:        #2fd7f0;
  --cyan-bright: #6ff0ff;
  --cyan-deep:   #0b7f97;
  --cyan-ink:    #042c36;
  --glow:        rgba(47,215,240,0.45);
  --glow-soft:   rgba(47,215,240,0.15);

  /* chrome / metal */
  --chrome-1:    #f4f8fb;
  --chrome-2:    #b9c6d2;
  --chrome-3:    #6e7e8d;

  /* type */
  --font:  'Vazirmatn', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* shape */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* container */
  --maxw: 1240px;
  --pad:  clamp(20px, 5vw, 64px);

  /* shadows */
  --shadow:      0 24px 60px -20px rgba(0,0,0,0.7);
  --shadow-cyan: 0 0 0 1px var(--line-cyan), 0 22px 60px -24px var(--glow);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.75;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--cyan); color: #03161b; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }

/* ---- layout helpers ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: ''; width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

/* ---- buttons ---- */
.btn {
  --bh: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--bh); padding-inline: 26px;
  border-radius: 999px;
  font-family: var(--font); font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s, border-color .25s, color .25s;
  white-space: nowrap; user-select: none;
}
.btn .mono { font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan-bright), var(--cyan));
  color: #03171c;
  box-shadow: 0 10px 30px -10px var(--glow), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost {
  background: rgba(255,255,255,0.02);
  border-color: var(--line-2);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--line-cyan); color: var(--cyan-bright); transform: translateY(-2px); }
.btn-sm { --bh: 42px; padding-inline: 18px; font-size: 14px; }

/* ---- chrome text ---- */
.chrome {
  background: linear-gradient(180deg, var(--chrome-1) 0%, var(--chrome-2) 45%, var(--chrome-3) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---- scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-deep); }

/* ---- reveal on scroll (GSAP-driven) ----
   Hidden up-front via opacity:0 (NO css transition — transitions freeze
   under the constant WebGL repaint). GSAP animates to an explicit end
   state; a ticker-liveness watchdog force-shows anything left hidden when
   the rAF clock isn't running, so content can never get stuck invisible. */
[data-reveal] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- pills / badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  direction: ltr;
}
.badge .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-mute); }
.badge.is-active { color: var(--cyan-bright); border-color: var(--line-cyan); }
.badge.is-active .dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 2s infinite; }
.badge.is-custom { color: #d7b96a; border-color: rgba(215,185,106,.3); }
.badge.is-custom .dot { background: #d7b96a; box-shadow: 0 0 8px rgba(215,185,106,.6); }
.badge.is-soon { color: var(--text-mute); }

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.8); }
}

/* ============================================================
   EXTRA MOTION — all transform/opacity only (GPU-cheap)
   ============================================================ */

/* drifting hero glows */
@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-3vw,2.4vw,0); } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(3.4vw,-2vw,0); } }
.glow.g1 { animation: drift1 16s ease-in-out infinite; }
.glow.g2 { animation: drift2 19s ease-in-out infinite; }
.glow.g3 { animation: drift1 22s ease-in-out infinite reverse; }

/* floating fact icons + card glyphs */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.fact .ic, .card-glyph { animation: floaty 5.5s ease-in-out infinite; }
.bots-grid .card:nth-child(2n) .card-glyph { animation-delay: -1.8s; }
.bots-grid .card:nth-child(3n) .card-glyph { animation-delay: -3.2s; }
.facts .fact:nth-child(2) .ic { animation-delay: -1.4s; }
.facts .fact:nth-child(3) .ic { animation-delay: -2.8s; }

/* chrome heading shimmer sweep — diagonal moving highlight */
@keyframes chromeSweep { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }
.chrome {
  background-image: linear-gradient(108deg,
    var(--chrome-1) 0%, var(--chrome-2) 30%,
    #ffffff 46%, var(--chrome-2) 60%, var(--chrome-3) 100%);
  background-size: 250% 100%;
  animation: chromeSweep 6.5s linear infinite;
}

/* eyebrow + latin slow shimmer on cyan */
@keyframes hueGlow { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
.eyebrow { animation: hueGlow 4s ease-in-out infinite; }

/* social / fact rows: gentle entrance bob handled by reveal; add hover already exists */

/* button press feedback */
.btn { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s, background .25s, color .25s; }
.btn:active { transform: translateY(1px) scale(.985); }

/* card glyph subtle glow breathing */
@keyframes glyphGlow { 0%,100% { box-shadow: 0 0 0 1px var(--line-cyan), 0 0 0 0 rgba(47,215,240,0); } 50% { box-shadow: 0 0 0 1px var(--line-cyan), 0 0 22px -4px var(--glow); } }
.card-glyph { animation: floaty 5.5s ease-in-out infinite, glyphGlow 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .glow, .fact .ic, .card-glyph, .chrome, .eyebrow, .logo-stage .ring, .logo-stage .halo { animation: none !important; }
}

/* ============================================================
   LITE MODE — weak / low-memory phones. Cut every expensive paint.
   ============================================================ */
/* the WebGL tunnel auto-throttles its own particle count on weak
   devices, so we keep it — but drop the heaviest CSS paints below. */

/* backdrop-filter is one of the most expensive things on mobile GPUs */
html.lite .nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
html.lite .nav.stuck { background: color-mix(in srgb, var(--bg) 97%, transparent); }

/* big blur radii are costly — shrink them hard */
html.lite .glow { filter: blur(46px); opacity: .4; animation: none !important; }
html.lite .logo-stage .ring { filter: blur(4px); animation: spin 14s linear infinite; }
html.lite .logo-stage .halo { animation: none !important; }

/* drop continuous looping animations; keep one-shot reveals */
html.lite .fact .ic,
html.lite .card-glyph { animation: none !important; }
html.lite .chrome { animation: none !important; }
html.lite .eyebrow { animation: none !important; }
html.lite .badge.is-active .dot { animation: none !important; }

/* faster, lighter reveals; no will-change left pinned */
html.lite [data-reveal] {
  transition-duration: .5s;
  will-change: auto;
}

/* kill card 3D tilt cost: flatten transform layer */
html.lite .card { transform: none !important; transform-style: flat; }
html.lite .card::before { display: none; }
