/* ============================================
   NAVETTA DESIGN SYSTEM v2
   International Enterprise AI Website
   Fonts: Gambarino (headlines), Inter (body), Space Mono (buttons/code)
   Arabic: Aref Ruqaa (headlines), IBM Plex Sans Arabic (body)
   ============================================ */

/* ========================================
   FONT FACES
   ======================================== */
@font-face {
    font-family: 'Gambarino';
    src: url('../assets/fonts/Gambarino-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Space Mono from Google Fonts fallback */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* Arabic fonts */
@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Inter (already used, ensure all weights) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   CSS CUSTOM PROPERTIES (TOKENS)
   ======================================== */
:root {
    /* === Typography === */
    --font-headline: 'Gambarino', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
    --font-brand: 'Inter', sans-serif; /* "Navetta" always in Inter */

    /* Arabic font overrides (applied via [lang="ar"]) */
    --font-headline-ar: 'Aref Ruqaa', serif;
    --font-body-ar: 'IBM Plex Sans Arabic', sans-serif;

    /* === Font Sizes (fluid) === */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
    --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.875rem);
    --text-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1rem);
    --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
    --text-xl: clamp(1.1875rem, 1.1rem + 0.4vw, 1.25rem);
    --text-2xl: clamp(1.375rem, 1.2rem + 0.75vw, 1.5rem);
    --text-3xl: clamp(1.75rem, 1.5rem + 1vw, 2rem);
    --text-4xl: clamp(2rem, 1.75rem + 1.25vw, 2.5rem);
    --text-5xl: clamp(2.5rem, 2rem + 2vw, 3.5rem);
    --text-6xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);

    /* === Colors — Dark Theme (Cool Purple/Indigo) === */
    --color-bg-primary: #0a0f1a;
    --color-bg-secondary: #111827;
    --color-bg-tertiary: #1f2937;
    --color-bg-elevated: #1a1f2e;

    --color-surface-glass: rgba(255, 255, 255, 0.06);
    --color-surface-glass-hover: rgba(255, 255, 255, 0.10);
    --color-surface-glass-active: rgba(255, 255, 255, 0.14);

    --color-border-glass: rgba(255, 255, 255, 0.12);
    --color-border-glass-hover: rgba(255, 255, 255, 0.22);
    --color-border-accent: rgba(99, 102, 241, 0.4);

    /* Accent Colors */
    --color-accent: #818cf8;
    --color-accent-bright: #a5b4fc;
    --color-accent-dim: #6366f1;
    --color-accent-secondary: #10b981;
    --color-accent-warning: #fbbf24;
    --color-accent-danger: #f87171;

    /* Text Colors */
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-muted: #9ca3af;
    --color-text-dim: #6b7280;

    /* === Gradients === */
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-cta: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);

    /* === Spacing === */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

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

    /* === Shadows === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.6);
    --shadow-glow-accent: 0 0 40px rgba(99, 102, 241, 0.4);
    --shadow-glow-success: 0 0 40px rgba(16, 185, 129, 0.3);

    /* === Transitions === */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* === Layout === */
    --max-width: 1280px;
    --max-width-narrow: 900px;
    --max-width-wide: 1440px;

    /* === Z-index layers === */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-navbar: 1000;
    --z-modal: 2000;
    --z-toast: 3000;

    /* === Pointillism noise overlay === */
    --noise-opacity: 0.03;
}

/* ========================================
   POINTILLISM NOISE LAYER
   ======================================== */
.noise-overlay::after,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--noise-opacity);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0.5px, transparent 0.5px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.12) 0.5px, transparent 0.5px),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.10) 0.3px, transparent 0.3px),
        radial-gradient(circle at 60% 60%, rgba(255,255,255,0.08) 0.4px, transparent 0.4px);
    background-size: 3px 3px, 5px 5px, 4px 4px, 6px 6px;
}

/* ========================================
   BASE RESET WITH DS v2
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 80% at 20% 20%, rgba(99, 102, 241, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 70% 70% at 80% 80%, rgba(139, 92, 246, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 100% 100% at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 80%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundPulse 12s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}


/* ========================================
   TYPOGRAPHY (DS v2)
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    color: var(--color-text-primary);
    font-weight: 400; /* Gambarino is display, use normal weight */
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-5xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* Utility text classes */
.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-accent { color: var(--color-accent-bright); }
.text-success { color: var(--color-accent-secondary); }
.text-mono { font-family: var(--font-mono); }
.text-brand { font-family: var(--font-brand); }

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

.container--wide {
    max-width: var(--max-width-wide);
}

.section {
    padding: var(--space-24) 0;
    position: relative;
}

.section--alt {
    background: var(--color-bg-secondary);
}

/* ========================================
   BUTTONS (DS v2 — Space Mono)
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--gradient-cta);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.6);
}

.btn--secondary {
    background: var(--color-surface-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-border-glass);
    color: var(--color-text-primary);
}

.btn--secondary:hover {
    background: var(--color-surface-glass-hover);
    border-color: var(--color-border-glass-hover);
    transform: translateY(-3px);
}

.btn--ghost {
    background: transparent;
    color: var(--color-accent-bright);
    border: 1px solid var(--color-border-accent);
}

.btn--ghost:hover {
    background: rgba(99, 102, 241, 0.1);
}

.btn--full { width: 100%; justify-content: center; }

.btn__arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn--primary:hover .btn__arrow,
.btn--secondary:hover .btn__arrow {
    transform: translateX(4px);
}

/* ========================================
   GLASSMORPHISM CARDS (DS v2)
   ======================================== */
.glass-card {
    background: var(--gradient-glass);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--color-border-glass);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.glass-card:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%);
    border-color: var(--color-border-glass-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), var(--shadow-glow-accent);
}

/* ========================================
   SECTION HEADERS (DS v2)
   ======================================== */
.section-header {
    margin-bottom: var(--space-16);
}

.section-header--center {
    text-align: center;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-accent-bright);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

.section-title {
    margin-bottom: var(--space-6);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 640px;
}

.section-header--center .section-subtitle {
    margin: 0 auto;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* AOS-like data attributes */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-in"] { transform: none; }
[data-aos="slide-left"] { transform: translateX(-30px); }
[data-aos="slide-right"] { transform: translateX(30px); }

[data-aos].aos-animate {
    opacity: 1;
    transform: none;
}

/* ========================================
   ARABIC / RTL TYPOGRAPHY OVERRIDES
   ======================================== */
[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] h6 {
    font-family: var(--font-headline-ar);
}

[lang="ar"] body,
[lang="ar"] p,
[lang="ar"] span,
[lang="ar"] a,
[lang="ar"] li,
[lang="ar"] input,
[lang="ar"] textarea,
[lang="ar"] select,
[lang="ar"] button {
    font-family: var(--font-body-ar);
}

/* "Navetta" brand name always in Inter/Latin */
[lang="ar"] .brand-name,
[lang="ar"] .nav-logo .logo-text,
[lang="ar"] .footer-logo {
    font-family: var(--font-brand) !important;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Buttons stay in Space Mono for all languages */
[lang="ar"] .btn {
    font-family: var(--font-mono);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (max-width: 1024px) {
    .section { padding: var(--space-16) 0; }
}

@media (max-width: 768px) {
    .section { padding: var(--space-12) 0; }
    .container { padding: 0 var(--space-4); }
}

@media (max-width: 480px) {
    .section { padding: var(--space-10) 0; }
}
