/* ==========================================================================
   NOVORA Luxury Digital Agency — Design System Foundation
   File: base.css
   Language: Arabic (RTL)
   ========================================================================== */

/* 1. Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Changa:wght@400;500;600;700;800&family=Tajawal:wght@300;400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* 2. CSS Custom Properties (:root)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --emerald: #10B981;
  --forest: #064E3B;
  --near-black: #0B0B0B;
  --slate: #1F2937;
  --cool-grey: #9CA3AF;
  --ice: #F8FAFC;
  --navy: #182E6F;

  /* Gradients */
  --gradient-aurora: linear-gradient(135deg, #182E6F, #10B981);
  --gradient-forest: linear-gradient(180deg, #064E3B, #0B0B0B);
  --gradient-steel: linear-gradient(90deg, #1F2937, #0B0B0B);
  --gradient-emerald-glow: radial-gradient(circle at center, rgba(16, 185, 129, 0.15), transparent 70%);

  /* Typography */
  --font-display: 'Changa', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Fluid Type Scale */
  --font-hero: clamp(2.5rem, 5vw, 4.5rem);
  --font-h1: clamp(2rem, 4vw, 3.5rem);
  --font-h2: clamp(1.5rem, 3vw, 2.25rem);
  --font-h3: clamp(1.125rem, 2vw, 1.5rem);
  --font-body-size: clamp(1rem, 1.2vw, 1.125rem);
  --font-small: 0.875rem;
  --font-label: 0.75rem;

  /* Layout */
  --container-max: 1200px;
  --section-padding: clamp(4rem, 8vw, 8rem);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;

  /* Transitions */
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s ease;
}

/* 3. Global Reset & Box-Sizing
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 4. Document-Level Setup (RTL Arabic)
   -------------------------------------------------------------------------- */
html {
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  background-color: var(--near-black);
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-body-size);
  color: var(--cool-grey);
  background-color: var(--near-black);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* 5. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--ice);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: var(--font-h1);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--font-h2);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--font-h3);
}

h4 {
  font-size: 1.125rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover,
a:focus-visible {
  color: var(--emerald);
}

/* Images & Media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Form Elements Reset */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* 6. Layout & Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline-start: auto;
  margin-inline-end: auto;
  padding-inline-start: clamp(1.5rem, 4vw, 3rem);
  padding-inline-end: clamp(1.5rem, 4vw, 3rem);
}

.section {
  padding-block-start: var(--section-padding);
  padding-block-end: var(--section-padding);
  position: relative;
  width: 100%;
}

/* Section Background Variations */
.section-dark {
  background-color: var(--near-black);
  color: var(--cool-grey);
}

.section-light {
  background-color: var(--ice);
  color: var(--slate);
}

.section-light h1,
.section-light h2,
.section-light h3,
.section-light h4 {
  color: var(--near-black);
}

.section-light p {
  color: var(--slate);
}

.section-slate {
  background-color: var(--slate);
  color: var(--cool-grey);
}

.section-gradient {
  background: var(--gradient-aurora);
}

/* 7. Scrollbar
   -------------------------------------------------------------------------- */
/* Standard modern browsers */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--slate) var(--near-black);
}

/* WebKit-based browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--near-black);
}

::-webkit-scrollbar-thumb {
  background-color: var(--slate);
  border-radius: 4px;
  border: 2px solid var(--near-black);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--emerald);
}

/* 8. Text Selection
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--emerald);
  color: var(--near-black);
}

::-moz-selection {
  background-color: var(--emerald);
  color: var(--near-black);
}

/* 9. Utility Classes
   -------------------------------------------------------------------------- */
/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Text alignments */
.text-center {
  text-align: center;
}

.text-start {
  text-align: right;
}

.text-end {
  text-align: left;
}

.text-emerald {
  color: var(--emerald);
}

.text-ice {
  color: var(--ice);
}

.text-cool-grey {
  color: var(--cool-grey);
}

/* Smooth Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Delays for child reveals */
.reveal-delay-1 {
  transition-delay: 0.15s;
}

.reveal-delay-2 {
  transition-delay: 0.3s;
}

.reveal-delay-3 {
  transition-delay: 0.45s;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 10. Print Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  .navbar,
  .footer,
  .whatsapp-fab,
  .popup-overlay,
  .nav-hamburger,
  .hero-scroll {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  h1, h2, h3, h4 {
    color: #000000 !important;
    page-break-after: avoid;
  }

  .section {
    padding: 1.5rem 0 !important;
    page-break-inside: avoid;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
