@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --charcoal: #2b2b2b;
  --graphite: #3d3d3d;
  --slate: #6b7280;
  --silver: #9ca3af;
  --cloud: #f3f4f6;
  --snow: #fafafa;
  --accent: #c8102e;
  --kraft: #c4a882;
  --kraft-dark: #b08d6a;
  --kraft-light: #d4bc9a;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Kufi Arabic', sans-serif;
  background: var(--snow);
  color: var(--charcoal);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.7;
}

::selection { background: var(--accent); color: #fff; }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== PRELOADER ===== */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader img { width: 80px; height: 80px; animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: all 0.3s;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}
.navbar.scrolled {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.navbar-logo img { height: 48px; width: auto; object-fit: contain; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.875rem; transition: color 0.3s;
  color: rgba(255,255,255,0.8); position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; right: 0;
  width: 0; height: 2px; background: #fff; transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: #fff; }
.navbar.scrolled .nav-links a { color: var(--graphite); }
.navbar.scrolled .nav-links a:hover { color: var(--charcoal); }
.navbar.scrolled .nav-links a::after { background: var(--charcoal); }

/* Mobile menu */
.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; background: none; border: none; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: #fff; transition: all 0.3s; }
.navbar.scrolled .menu-toggle span { background: var(--charcoal); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  overflow: hidden; max-height: 0; transition: max-height 0.3s;
}
.mobile-menu.open { max-height: 300px; }
.mobile-menu ul { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; }
.mobile-menu a { color: var(--graphite); font-size: 1.125rem; }
.mobile-menu a:hover { color: var(--charcoal); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu { display: block; }
}

/* ===== HERO SLIDER ===== */
.hero { position: relative; height: 100vh; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.7s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero-slide-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--charcoal), var(--graphite));
}
.hero-slide-bg img, .hero-slide-bg video {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay { position: absolute; inset: 0; background: rgba(43,43,43,0.6); }

.hero-decorations { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero-decorations .shape-1 { position: absolute; top: 80px; left: 40px; width: 160px; height: 160px; border: 2px solid rgba(255,255,255,0.1); transform: rotate(12deg); }
.hero-decorations .shape-2 { position: absolute; bottom: 128px; right: 80px; width: 240px; height: 1px; background: rgba(255,255,255,0.1); }
.hero-decorations .shape-3 { position: absolute; top: 33%; right: 40px; width: 80px; height: 80px; background: rgba(255,255,255,0.05); transform: rotate(45deg); }

.hero-content {
  position: relative; z-index: 2; height: 100%; display: flex; align-items: center;
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
}
.hero-text { max-width: 768px; }
.hero-text .line { width: 64px; height: 4px; background: #fff; margin-bottom: 2rem; }
.hero-text h1 { font-size: 3rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 1rem; }
.hero-text h1 span { color: var(--silver); }
.hero-text p { font-size: 1.125rem; color: var(--silver); margin-bottom: 2.5rem; max-width: 640px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-btns a {
  padding: 0.875rem 2rem; font-size: 0.875rem; font-weight: 500;
  font-family: 'Noto Kufi Arabic', sans-serif; transition: all 0.3s;
}
.btn-primary { background: #fff; color: var(--charcoal); }
.btn-primary:hover { background: var(--cloud); }
.btn-outline { border: 2px solid #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--charcoal); }

.hero-arrows {
  position: absolute; bottom: 3rem; left: 1.5rem; z-index: 3;
  display: flex; gap: 0.75rem;
}
.hero-arrows button {
  width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.3);
  background: none; color: #fff; cursor: pointer; font-size: 1rem;
  transition: all 0.3s; display: flex; align-items: center; justify-content: center;
}
.hero-arrows button:hover { background: #fff; color: var(--charcoal); }

.hero-indicators {
  position: absolute; bottom: 3rem; right: 1.5rem; z-index: 3;
  display: flex; gap: 0.5rem;
}
.hero-indicators button {
  height: 4px; border: none; cursor: pointer; transition: all 0.3s;
  background: rgba(255,255,255,0.3); width: 20px;
}
.hero-indicators button.active { width: 40px; background: #fff; }

@media (max-width: 768px) {
  .hero-text h1 { font-size: 2rem; }
  .hero-text p { font-size: 1rem; }
}

/* ===== SECTIONS COMMON ===== */
.section { padding: 6rem 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.section-line { width: 48px; height: 4px; background: var(--charcoal); margin-bottom: 1rem; }
.section-title { font-size: 2rem; font-weight: 800; color: var(--charcoal); margin-bottom: 1rem; }
.section-subtitle { color: var(--slate); margin-bottom: 4rem; max-width: 540px; }

/* Animate on scroll */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.6s, transform 0.6s; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-image { position: relative; height: 256px; background: var(--cloud); overflow: hidden; }
.about-image img { width: 100%; height: 100%; object-fit: cover; }
.about-image-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  color: var(--silver); font-size: 3rem;
}
.about-story { background: var(--cloud); padding: 2rem; position: relative; }
.about-story-corner { position: absolute; top: 0; right: 0; width: 64px; height: 64px; border-top: 2px solid rgba(43,43,43,0.2); border-right: 2px solid rgba(43,43,43,0.2); }
.about-story h3 { font-size: 1.25rem; font-weight: 700; color: var(--charcoal); margin-bottom: 1rem; }
.about-story p { color: var(--slate); line-height: 2; }
.about-story p + p { margin-top: 1rem; }

.founder { border-right: 4px solid var(--charcoal); padding-right: 1.5rem; }
.founder h3 { font-size: 1.25rem; font-weight: 700; color: var(--charcoal); margin-bottom: 0.5rem; }
.founder .name { font-size: 1.125rem; font-weight: 600; color: var(--graphite); }
.founder .bio { color: var(--slate); font-size: 0.875rem; margin-top: 0.25rem; }

.values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.value-card { background: var(--cloud); padding: 1.25rem; }
.value-card i { color: var(--charcoal); font-size: 1.25rem; }
.value-card h4 { font-weight: 700; color: var(--charcoal); margin-top: 0.75rem; font-size: 0.875rem; }
.value-card p { color: var(--slate); font-size: 0.75rem; margin-top: 0.25rem; }

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ===== PRODUCTS ===== */
.products-section {
  position: relative; overflow: hidden;
  background-color: #f5f0e8;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(0,0,0,0.03) 4px, rgba(0,0,0,0.03) 5px),
    repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0,0,0,0.015) 20px, rgba(0,0,0,0.015) 21px);
}
.products-section .border-line { position: absolute; left: 0; right: 0; height: 1px; background: rgba(43,43,43,0.1); }
.products-section .border-line.top { top: 0; }
.products-section .border-line.bottom { bottom: 0; }

.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; position: relative; z-index: 10; }
.product-card {
  background: #fff; overflow: hidden; position: relative;
  transition: background 0.3s, color 0.3s; cursor: default;
}
.product-card:hover { background: var(--charcoal); }
.product-card-corner {
  position: absolute; top: 0; left: 0; width: 32px; height: 32px;
  border-top: 2px solid rgba(43,43,43,0.1); border-left: 2px solid rgba(43,43,43,0.1);
  transition: border-color 0.3s;
}
.product-card:hover .product-card-corner { border-color: rgba(255,255,255,0.2); }
.product-card-img { position: relative; height: 192px; background: var(--cloud); overflow: hidden; }
.product-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  color: var(--silver); font-size: 2.5rem;
}
.product-card-body { padding: 1.5rem; }
.product-card h3 { font-size: 1.125rem; font-weight: 700; color: var(--charcoal); margin-bottom: 0.75rem; transition: color 0.3s; }
.product-card:hover h3 { color: #fff; }
.product-card p { font-size: 0.875rem; color: var(--slate); line-height: 1.8; transition: color 0.3s; }
.product-card:hover p { color: var(--silver); }

@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .products-grid { grid-template-columns: 1fr; } }

/* 3D Floating Boxes */
.floating-boxes { position: absolute; inset: 0; pointer-events: none; opacity: 0.3; }
.floating-box {
  position: absolute; transform-style: preserve-3d;
  animation: floatBox 12s ease-in-out infinite;
}
.floating-box .face {
  position: absolute; background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px);
}
.floating-box .front { background-color: var(--kraft); }
.floating-box .back { background-color: var(--kraft-dark); transform: translateZ(calc(var(--s) * -0.5)) rotateY(180deg); }
.floating-box .right { background-color: var(--kraft-dark); transform: translateX(calc(var(--s) * 0.5)) rotateY(90deg); }
.floating-box .left { background-color: var(--kraft); transform: translateX(calc(var(--s) * -0.5)) rotateY(-90deg); }
.floating-box .top { background-color: var(--kraft-light); transform: translateY(calc(var(--s) * -0.5)) rotateX(90deg); }
.floating-box .bottom { background-color: var(--kraft-dark); transform: translateY(calc(var(--s) * 0.5)) rotateX(-90deg); }
.floating-box .tape {
  position: absolute; background: rgba(200,180,140,0.5);
  width: 15%; left: 42.5%; height: 100%;
  transform: translateZ(calc(var(--s) * 0.5 + 1px));
}

.box-1 { left: 5%; top: 10%; --s: 60px; animation-delay: 0s; animation-duration: 12s; }
.box-2 { left: 85%; top: 15%; --s: 45px; animation-delay: 1.5s; animation-duration: 10s; }
.box-3 { left: 90%; top: 60%; --s: 35px; animation-delay: 3s; animation-duration: 14s; }
.box-4 { left: 3%; top: 70%; --s: 50px; animation-delay: 2s; animation-duration: 11s; }
.box-5 { left: 75%; top: 80%; --s: 28px; animation-delay: 4s; animation-duration: 13s; }
.box-6 { left: 15%; top: 45%; --s: 40px; animation-delay: 0.5s; animation-duration: 15s; }
.box-7 { left: 50%; top: 5%; --s: 32px; animation-delay: 2.5s; animation-duration: 9s; }

.floating-box .face {
  width: var(--s); height: var(--s);
}
.floating-box .front { transform: translateZ(calc(var(--s) * 0.5)); }

@keyframes floatBox {
  0%, 100% { transform: rotateX(15deg) rotateY(-25deg) translateY(0); }
  25% { transform: rotateX(20deg) rotateY(-5deg) translateY(-20px); }
  50% { transform: rotateX(10deg) rotateY(15deg) translateY(0); }
  75% { transform: rotateX(18deg) rotateY(-10deg) translateY(15px); }
}

@media (max-width: 768px) { .floating-boxes { display: none; } }

/* ===== CLIENTS ===== */
.clients-section { background: var(--charcoal); color: #fff; position: relative; overflow: hidden; }
.clients-section .section-line { background: #fff; }
.clients-section .section-title { color: #fff; }
.clients-section .section-subtitle { color: var(--silver); }
.clients-decorations { position: absolute; inset: 0; pointer-events: none; }
.clients-decorations .cd-1 { position: absolute; top: 40px; left: 40px; width: 128px; height: 128px; border: 1px solid rgba(255,255,255,0.05); transform: rotate(12deg); }
.clients-decorations .cd-2 { position: absolute; bottom: 40px; right: 80px; width: 192px; height: 192px; border: 1px solid rgba(255,255,255,0.05); border-radius: 50%; }

.sectors-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.sector-card {
  background: rgba(255,255,255,0.05); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1); padding: 1.5rem; text-align: center;
  transition: background 0.3s;
}
.sector-card:hover { background: rgba(255,255,255,0.1); }
.sector-card i { font-size: 1.875rem; margin-bottom: 0.75rem; display: block; }
.sector-card span { font-size: 0.875rem; font-weight: 500; }

.trust-bar {
  margin-top: 4rem; padding-top: 4rem; border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center; color: var(--silver); font-size: 1.125rem;
}
.trust-bar strong { color: #fff; }

@media (max-width: 1024px) { .sectors-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .sectors-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-info { display: flex; flex-direction: column; gap: 2rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon {
  width: 40px; height: 40px; background: var(--cloud); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--charcoal);
}
.contact-item .label { font-size: 0.875rem; color: var(--slate); }
.contact-item .value { color: var(--charcoal); font-weight: 500; }
.contact-item a:hover { text-decoration: underline; }

.contact-map { height: 192px; background: var(--cloud); }
.contact-map iframe { width: 100%; height: 100%; border: 0; }

.contact-form { background: var(--cloud); padding: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--charcoal); margin-bottom: 0.5rem; }
.form-group input, .form-group textarea {
  width: 100%; background: #fff; border: 1px solid rgba(156,163,175,0.3);
  padding: 0.75rem 1rem; font-size: 0.875rem; font-family: 'Noto Kufi Arabic', sans-serif;
  transition: border-color 0.3s; outline: none;
  direction: rtl; text-align: right;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--charcoal); }
.form-group input::placeholder, .form-group textarea::placeholder {
  direction: rtl; text-align: right;
}
.form-group textarea { resize: none; }

.submit-btn {
  width: 100%; background: var(--charcoal); color: #fff;
  padding: 0.875rem; font-size: 0.875rem; font-weight: 500;
  font-family: 'Noto Kufi Arabic', sans-serif;
  border: none; cursor: pointer; transition: background 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.submit-btn:hover { background: var(--graphite); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.submit-btn .spinner { width: 20px; height: 20px; animation: spin 1s linear infinite; filter: brightness(0) invert(1); }

.form-status {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem; font-size: 0.875rem; margin-top: 1.25rem;
}
.form-status.success { background: #f0fdf4; color: #15803d; }
.form-status.error { background: #fef2f2; color: #b91c1c; }

@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

/* ===== FOOTER ===== */
.footer { background: var(--charcoal); color: #fff; padding: 3rem 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-logo img { height: 48px; width: auto; object-fit: contain; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer p { color: var(--silver); font-size: 0.875rem; line-height: 1.8; }
.footer h4 { font-weight: 700; margin-bottom: 1rem; }
.footer ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer ul a { color: var(--silver); font-size: 0.875rem; transition: color 0.3s; }
.footer ul a:hover { color: #fff; }
.footer-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: rgba(255,255,255,0.1);
  transition: background 0.3s; margin-top: 1rem;
}
.footer-social:hover { background: rgba(255,255,255,0.2); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem; color: var(--silver); flex-wrap: wrap; gap: 0.5rem;
}
.footer-bottom a { color: #fff; transition: color 0.3s; }
.footer-bottom a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .section-title { font-size: 1.5rem; }
}
