/* ============================================
   Novix — Design System & Premium Styles
   ============================================ */

/* ----- Brand Colors ----- */
:root {
  --novix-royal-maroon: #7c252f;
  --novix-gunmetal: #333333;
  --novix-royal-red: #cc3e4f;
  --novix-grey: #9ea9a3;
  --novix-white: #ffffff;
  --novix-ocean-blue: #3185fc;
}

/* ----- Design Tokens (8px grid, pixel-perfect) ----- */
:root {
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.6s;
}

/* ----- Smooth scroll (native + enhanced by Lenis in JS) ----- */
html {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ----- Typography — Google Fonts applied in HTML ----- */
body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  color: var(--novix-gunmetal);
  padding-top: 72px;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Navbar (refined, with scroll state) ----- */
.navbar-novix {
  background: var(--novix-white) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--duration-normal) var(--ease-out-quart),
              background var(--duration-normal);
  padding: var(--space-2) 0;
}

.navbar-novix.navbar-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.navbar-novix .navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--novix-gunmetal);
  transition: color var(--duration-fast);
}

.navbar-novix .navbar-brand .logo-accent {
  color: var(--novix-royal-maroon);
}

.navbar-novix .nav-link {
  color: var(--novix-gunmetal) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--space-2) var(--space-3) !important;
  margin: 0 var(--space-1);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.navbar-novix .nav-link:hover,
.navbar-novix .nav-link:focus {
  color: var(--novix-royal-red) !important;
  background: rgba(204, 62, 79, 0.06);
}

.navbar-novix .nav-link.active {
  color: var(--novix-royal-red) !important;
  border-bottom: 2px solid var(--novix-royal-red);
}

.btn-novix-primary {
  background: var(--novix-gunmetal);
  color: var(--novix-white) !important;
  border: none;
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  transition: background var(--duration-normal) var(--ease-out-quart),
              transform var(--duration-fast);
}

.btn-novix-primary:hover {
  background: var(--novix-royal-maroon);
  color: var(--novix-white) !important;
  transform: translateY(-1px);
}

/* ----- Hero with Parallax ----- */
.hero-novix {
  position: relative;
  height: 85vh;
  min-height: 480px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.hero-novix .carousel,
.hero-novix .carousel-inner,
.hero-novix .carousel-item {
  height: 100%;
  min-height: 100%;
}

.hero-novix .carousel-item {
  position: relative;
  overflow: hidden;
}

/* طبقة الخلفية — تملأ الشريحة وتظهر الصورة */
.hero-parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: var(--novix-gunmetal);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  /* Ken Burns: حركة بطيئة لتبدو الخلفية حية */
  animation: hero-kenburns 10s ease-in-out infinite alternate;
}

.hero-novix .carousel-item.active .hero-parallax-layer {
  animation-play-state: running;
}

.hero-novix .carousel-item:not(.active) .hero-parallax-layer {
  animation-play-state: paused;
}

@keyframes hero-kenburns {
  0% {
    transform: scale(1) translate(0, 0) translateZ(0);
  }
  100% {
    transform: scale(1.12) translate(-2%, -1.5%) translateZ(0);
  }
}

.hero-novix .carousel-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(51, 51, 51, 0.35) 0%,
    rgba(51, 51, 51, 0.6) 60%,
    rgba(51, 51, 51, 0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-novix .carousel-caption {
  bottom: 18%;
  z-index: 2;
  padding: var(--space-6);
}

.hero-novix .carousel-caption .hero-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.hero-novix .carousel-item.active .carousel-caption .hero-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

.hero-novix .carousel-caption .hero-lead {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo) 0.2s, transform 0.7s var(--ease-out-expo) 0.2s;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.hero-novix .carousel-item.active .carousel-caption .hero-lead {
  opacity: 1;
  transform: translateY(0);
}

.hero-novix .carousel-control-prev,
.hero-novix .carousel-control-next {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  top: 50%;
  transform: translateY(-50%);
  opacity: 1;
  transition: background var(--duration-normal), transform var(--duration-fast);
}

.hero-novix .carousel-control-prev:hover,
.hero-novix .carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%) scale(1.05);
}

.hero-novix .carousel-control-prev { left: var(--space-6); }
.hero-novix .carousel-control-next { right: var(--space-6); }

/* Hero angle (hexagon-style transition) */
.hero-angle {
  height: 64px;
  background: var(--novix-white);
  position: relative;
  margin-top: -1px;
  clip-path: polygon(0 100%, 0 0, 50% 100%, 100% 0, 100% 100%);
}

/* ----- Reveal on scroll ----- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ----- Section titles ----- */
.section-title {
  font-weight: 800;
  color: var(--novix-gunmetal);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-subtitle {
  font-weight: 600;
  color: var(--novix-grey);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8125rem;
}

/* ----- Welcome section ----- */
.welcome-section {
  padding: var(--space-24) 0;
  background: var(--novix-white);
}

.welcome-section .lead-text {
  font-size: 1.0625rem;
  color: var(--novix-gunmetal);
  opacity: 0.88;
  line-height: 1.75;
}

/* ----- Hexagons ----- */
.hexagon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.hexagon {
  --hex-width: 140px;
  --hex-height: 162px;
  width: var(--hex-width);
  height: var(--hex-height);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--novix-white);
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.hexagon-wrapper:hover .hexagon {
  transform: scale(1.03);
}

.hexagon-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hexagon-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--novix-royal-maroon);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hexagon-stat-label {
  font-size: 0.6875rem;
  color: var(--novix-grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  margin-top: var(--space-2);
}

.hexagon-outer {
  width: var(--hex-width, 140px);
  height: var(--hex-height, 162px);
  background: var(--novix-grey);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.hexagon-outer:hover {
  transform: translateY(-4px);
}

.hexagon-outer .hexagon {
  width: 94%;
  height: 94%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--novix-white);
  flex-shrink: 0;
}

.hexagon-product {
  --hex-width: 120px;
  --hex-height: 138px;
  margin: 0 auto;
}

.hexagon-product .hexagon-inner {
  padding: var(--space-2);
}

.hexagon-product .hex-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-2);
  opacity: 0.9;
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.hexagon-outer:hover .hex-icon {
  transform: scale(1.08);
}

.hexagon-product .hex-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--novix-gunmetal);
  line-height: 1.35;
}

/* ----- Stats section ----- */
.stats-section {
  padding: var(--space-20) 0 var(--space-24);
  background: var(--novix-white);
}

/* ----- Products section ----- */
.products-section {
  padding: var(--space-20) 0 var(--space-24);
  background: var(--novix-white);
}

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

/* ----- Footer ----- */
.footer-novix {
  background: var(--novix-gunmetal);
  color: var(--novix-white);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-novix .btn-contact {
  background: var(--novix-royal-red);
  color: var(--novix-white) !important;
  border: none;
  padding: var(--space-3) var(--space-6);
  font-weight: 700;
  font-size: 1rem;
  margin-top: -3rem;
  position: relative;
  z-index: 2;
  border-radius: var(--radius-md);
  transition: background var(--duration-normal), transform var(--duration-fast),
              box-shadow var(--duration-normal);
}

.footer-novix .btn-contact:hover {
  background: var(--novix-royal-maroon);
  color: var(--novix-white) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124, 37, 47, 0.35);
}

.footer-novix a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer-novix a:hover {
  color: var(--novix-white);
}

.footer-novix .footer-divider {
  color: var(--novix-grey);
  margin: 0 var(--space-2);
}

/* ----- RTL ----- */
[dir="rtl"] .hexagon-stat-label {
  writing-mode: vertical-lr;
  transform: rotate(0);
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
  .hero-novix {
    min-height: 70vh;
  }
  .hero-novix .carousel-item {
    min-height: 70vh;
  }
  .hexagon-stat-value {
    font-size: 1.75rem;
  }
  .hero-novix .carousel-control-prev { left: var(--space-3); }
  .hero-novix .carousel-control-next { right: var(--space-3); }
}

@media (max-width: 575.98px) {
  body { padding-top: 64px; }
  .hexagon-stat-label {
    writing-mode: horizontal-tb;
    transform: none;
    margin-top: var(--space-2);
  }
  [dir="rtl"] .hexagon-stat-label {
    writing-mode: horizontal-tb;
  }
  .hero-novix .carousel-caption .hero-title {
    font-size: 1.75rem;
  }
}
