/* ============================================================
   GENIE FX ACADEMY — MAIN STYLESHEET
   Design Tokens, Typography, Reset, Utilities
   ============================================================ */

/* ---------- FONT FACES ---------- */
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Light.woff') format('woff');
  font-weight: 300; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Regular.woff') format('woff');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Medium.woff') format('woff');
  font-weight: 500; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Semibold.woff') format('woff');
  font-weight: 600; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Bold.woff') format('woff');
  font-weight: 700; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Heavy.woff') format('woff');
  font-weight: 800; font-style: normal;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('../english font/SF-Pro-Display-Black.woff') format('woff');
  font-weight: 900; font-style: normal;
}
@font-face {
  font-family: 'Almarai';
  src: url('../arabic font/Almarai-Light.ttf') format('truetype');
  font-weight: 300; font-style: normal;
}
@font-face {
  font-family: 'Almarai';
  src: url('../arabic font/Almarai-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Almarai';
  src: url('../arabic font/Almarai-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal;
}
@font-face {
  font-family: 'Almarai';
  src: url('../arabic font/Almarai-ExtraBold.ttf') format('truetype');
  font-weight: 800; font-style: normal;
}

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Brand Colors */
  --clr-primary:       #0181FA;
  --clr-primary-dark:  #0166CC;
  --clr-secondary:     #4664FF;
  --clr-accent:        #C0F000;
  --clr-light-blue:    #B9E4FF;

  /* Opacity variants */
  --clr-primary-60:    rgba(1, 129, 250, 0.6);
  --clr-primary-30:    rgba(1, 129, 250, 0.3);
  --clr-primary-15:    rgba(1, 129, 250, 0.15);
  --clr-primary-08:    rgba(1, 129, 250, 0.08);
  --clr-accent-20:     rgba(192, 240, 0, 0.2);

  /* Backgrounds — dark theme */
  --bg-base:           #07070A;
  --bg-surface:        #0E0E12;
  --bg-elevated:       #141418;
  --bg-card:           #1A1A20;
  --bg-card-hover:     #1F1F26;

  /* Text */
  --text-primary:      #F7FAFF;
  --text-secondary:    #B8BED0;
  --text-muted:        #838AA0;
  --text-accent:       #0181FA;

  /* Borders */
  --border-subtle:     rgba(255, 255, 255, 0.06);
  --border-card:       rgba(255, 255, 255, 0.08);
  --border-primary:    rgba(1, 129, 250, 0.25);
  --border-accent:     rgba(192, 240, 0, 0.35);

  /* Typography */
  --font-en:           'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ar:           'Almarai', 'Segoe UI', sans-serif;

  /* Spacing scale */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* Border Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   0.4s  cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm:   0 2px 8px  rgba(0,0,0,0.3);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 40px   rgba(1, 129, 250, 0.25);
  --shadow-glow-lg: 0 0 80px rgba(1, 129, 250, 0.3);

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--font-en);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Horizontal-overflow clipping: on <main>, NOT html/body ──
   Putting overflow-x on html/body turns the body into a scroll
   container, which detaches position:fixed descendants (the navbar)
   from the viewport — they scroll away with the page and only return
   at the very top. <main> is a sibling of <nav>, so clipping <main>
   contains the wide glow orbs / animated sections without ever
   affecting the fixed nav.

   Only `overflow: clip` is used (guarded by @supports). Unlike
   `overflow-x: hidden`, clip does NOT coerce overflow-y to `auto` and
   does NOT establish a scroll container — so the sticky pricing table
   and the fixed video overlay that live inside <main> keep working.
   Legacy browsers without clip support rely on the per-section
   overflow:hidden already set on hero / story / ai / chart sections. ── */
@supports (overflow: clip) {
  main {
    overflow-x: clip;
  }
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
ul, ol {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
input, textarea, select {
  font-family: inherit;
}
input[dir="auto"],
textarea[dir="auto"] {
  unicode-bidi: plaintext;
  text-align: start;
}

/* ---------- RTL SUPPORT ---------- */
[dir="rtl"] body {
  font-family: var(--font-ar);
}
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* ---------- TYPOGRAPHY ---------- */
.text-display {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.text-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.text-h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.text-h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.text-h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}
.text-body-lg {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.7;
}
.text-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, #0181FA 0%, #4664FF 50%, #B9E4FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-accent {
  background: linear-gradient(135deg, #C0F000 0%, #7EC800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.section {
  padding-block: var(--sp-16);
}
.section-sm {
  padding-block: var(--sp-12);
}

/* ---------- UTILITIES ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.gap-12 { gap: var(--sp-12); }
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-end { text-align: end; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* Direction-safe text islands shared across pages.
   This mirrors the pricing-page approach: page direction inherits normally,
   while mixed product names, market symbols, and numeric strings stay stable. */
.bidi-isolate,
.ltr-island,
.numeric-island,
.market-token,
.brand-token,
.symbol-token,
.nav-logo,
.section-badge,
.stat-number,
.footer-download-card,
.footer-download-label,
.footer-download-sub,
.footer-col a[href^="mailto:"],
.contact-method-link,
.contact-response-value,
.news-feature-card-meta,
.feature-benefit-item,
.blog-card-meta,
.blog-card-time,
.article-meta-item {
  unicode-bidi: isolate;
}

.ltr-island,
.numeric-island,
.market-token,
.symbol-token,
a[href^="mailto:"],
a[href^="tel:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] [data-i18n],
[dir="rtl"] [data-i18n-html] {
  unicode-bidi: isolate;
}

/* .features-page / .about-page / .contact-page no longer clip overflow at
   the body level — body-level overflow-x broke the fixed navbar (see the
   <main> clipping rule near the top of this file). Horizontal clipping is
   now handled globally by the `main` rule, so these page bodies stay
   overflow:visible and the fixed nav pins correctly to the viewport. */

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

/* Named layout grids (used in page templates) */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: center;
}
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  align-items: start;
}
.values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--sp-12);
  align-items: start;
}
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: center;
}

.hero-grid > *,
.plans-grid > *,
.values-grid > *,
.contact-grid > *,
.two-col-grid > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.feature-detail > * {
  min-width: 0;
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid,
  .two-col-grid,
  .contact-grid,
  .values-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
  .hero-grid .phone-wrap { display: none; } /* hide phone on small screens for clean layout */
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--sp-4); }
  .section { padding-block: var(--sp-16); }
  .form-name-row { grid-template-columns: 1fr !important; }
}

/* Section badge label */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  border: 1px solid var(--border-primary);
  background: var(--clr-primary-08);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--clr-primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}
[dir="rtl"] .section-badge { direction: rtl; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin-block: var(--sp-8);
}

/* Glow orbs (decorative background) */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.glow-orb-blue {
  background: radial-gradient(circle, rgba(1,129,250,0.35) 0%, transparent 70%);
}
.glow-orb-accent {
  background: radial-gradient(circle, rgba(192,240,0,0.2) 0%, transparent 70%);
}
.glow-orb-secondary {
  background: radial-gradient(circle, rgba(70,100,255,0.25) 0%, transparent 70%);
}

/* ========================
   NAVIGATION SCROLL STATE
   ======================== */
.nav.scrolled {
  background: rgba(8,10,15,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}
.nav-link-underline.active {
  color: var(--clr-primary) !important;
  font-weight: 600;
}

/* ============================================================
   HIGHLIGHT / COPY EMPHASIS CLASSES
   Used via data-i18n-html spans across all pages
   ============================================================ */

/* Blue highlight — primary brand colour, used for feature names & key terms */
.hl-blue {
  background: linear-gradient(135deg, #0181FA 0%, #4664FF 50%, #B9E4FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;          /* keep inline so line-wrapping works naturally */
  padding-bottom: 0.08em;   /* prevent descender clipping on LTR */
}

/* Lime/accent highlight — used for positive / action words */
.hl-lime {
  background: linear-gradient(135deg, #C0F000 0%, #7EC800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
  padding-bottom: 0.08em;
}

/* Bold emphasis — no colour, just weight, used for strong statements */
.hl-bold {
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   RTL / ARABIC TYPOGRAPHY FIXES
   Arabic script has tall ascenders, low descenders, and
   diacritical marks that need extra vertical room.
   Tight Latin line-heights clip Arabic characters badly.
   ============================================================ */

[dir="rtl"] .text-display {
  line-height: 1.55;
  letter-spacing: 0;
}
[dir="rtl"] .text-h1 {
  line-height: 1.6;
  letter-spacing: 0;
}
[dir="rtl"] .text-h2 {
  line-height: 1.55;
  letter-spacing: 0;
}
[dir="rtl"] .text-h3 {
  line-height: 1.5;
  letter-spacing: 0;
}
[dir="rtl"] .text-h4 {
  line-height: 1.55;
  letter-spacing: 0;
}

/* background-clip:text clips Arabic descenders — add bottom padding to make room */
[dir="rtl"] .text-gradient,
[dir="rtl"] .text-gradient-accent {
  padding-bottom: 0.18em;
  display: inline-block;
}

/* Same fix for highlight spans inside RTL headings */
[dir="rtl"] .hl-blue,
[dir="rtl"] .hl-lime {
  padding-bottom: 0.18em;
  display: inline-block;
}

/* ============================================================
   ARABIC CLIPPING — COMPREHENSIVE FIXES (all pages)
   Arabic characters have tall ascenders, deep descenders, and
   diacritical marks that get sliced by line-height:1 and
   negative letter-spacing. Fixed per-element below.
   ============================================================ */

/* --- Buttons ------------------------------------------------
   .btn uses line-height:1 → Arabic label text clips top/bottom */
[dir="rtl"] .btn {
  line-height: 1.5;
  letter-spacing: 0;
  white-space: normal;         /* allow wrapping for long Arabic labels */
}

/* --- Stat numbers ------------------------------------------
   line-height:1 + letter-spacing:-0.03em clips Arabic digits  */
[dir="rtl"] .stat-number {
  line-height: 1.3;
  letter-spacing: 0;
}

/* --- Pricing amounts ----------------------------------------
   line-height:1 + letter-spacing:-0.04em — fix for RTL context */
[dir="rtl"] .pricing-amount {
  line-height: 1.3;
  letter-spacing: 0;
}

/* --- App UI demo values -------------------------------------
   .app-balance-value uses line-height:1 + letter-spacing:-0.04em */
[dir="rtl"] .app-balance-value {
  line-height: 1.3;
  letter-spacing: 0;
}

/* --- Phone chip labels -------------------------------------
   line-height:1 clips Arabic micro-labels */
[dir="rtl"] .phone-chip-label {
  line-height: 1.4;
  letter-spacing: 0;
}

/* --- Negative letter-spacing — break Arabic joining ---------
   Any element still carrying negative tracking in RTL mode    */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .section-badge,
[dir="rtl"] .testimonial-name,
[dir="rtl"] .testimonial-role,
[dir="rtl"] .news-feature-card-title,
[dir="rtl"] .pricing-plan-name,
[dir="rtl"] .feature-card-title,
[dir="rtl"] .value-title,
[dir="rtl"] .contact-community-card p,
[dir="rtl"] .stat-label {
  letter-spacing: 0;
}

/* --- Page hero overflow:hidden + Arabic headings ------------
   Inner page heroes clip when content grows due to RTL line-height.
   Add bottom breathing room so descenders clear the boundary.   */
[dir="rtl"] .page-hero {
  padding-bottom: 80px;        /* was 64px — extra 16px for Arabic descenders */
}

/* --- Gradient text inside headings -------------------------
   Any gradient span not already covered by earlier rules      */
[dir="rtl"] span.text-gradient,
[dir="rtl"] span.text-gradient-accent {
  padding-bottom: 0.18em;
  display: inline-block;
}
