/* ==========================================================================
   IRAQCLOUDS SOLUTIONS — UNIFIED LIGHT DESIGN SYSTEM
   Inspired by Ubiquiti / Apple High-Performance Hardware & Enterprise UI
   ========================================================================== */

:root {
  --ui-bg: #ffffff;
  --ui-bg-subtle: #f8f9fa;
  --ui-bg-alt: #f3f5f8;
  --ui-card-bg: #ffffff;
  --ui-border: rgba(0, 0, 0, 0.08);
  --ui-border-hover: rgba(0, 0, 0, 0.18);
  --ui-blue: #0193d7;
  --ui-blue-hover: #007bb5;
  --ui-blue-subtle: rgba(1, 147, 215, 0.08);
  --ui-text-primary: #10141a;
  --ui-text-muted: #5e6573;
  --ui-text-dim: #8b929f;
  --ui-font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --ui-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Compatibility variables for light mode */
  --ui-black: #ffffff;
  --ui-dark-1: #ffffff;
  --ui-dark-2: #f8f9fa;
  --ui-dark-3: #f1f3f6;
  --ui-dark-4: #e2e5eb;
  --ui-text-white: #10141a;
}

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

html {
  scroll-behavior: smooth;
  background: #ffffff;
  color: var(--ui-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: var(--ui-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  font-size: 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ui-text-primary);
  line-height: 1.15;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* PRELOADER */
#preloader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.pre-indicator {
  width: 32px;
  height: 32px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--ui-blue);
  border-radius: 50%;
  animation: uiSpin 0.7s linear infinite;
}

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

/* CONTAINERS & UTILS */
.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 28px;
}

.section-wrap {
  padding: 100px 0;
  border-bottom: 1px solid var(--ui-border);
  position: relative;
}

.section-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ui-blue);
  margin-bottom: 14px;
  display: inline-block;
}

.section-headline {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--ui-text-primary);
}

.section-desc {
  color: var(--ui-text-muted);
  font-size: 1.0625rem;
  max-width: 640px;
  line-height: 1.6;
}

/* BUTTONS */
.btn-ui-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ui-blue);
  color: #ffffff !important;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--ui-blue);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(1, 147, 215, 0.2);
  transition: var(--ui-transition);
}

.btn-ui-primary:hover {
  background: var(--ui-blue-hover);
  border-color: var(--ui-blue-hover);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(1, 147, 215, 0.28);
}

.btn-ui-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--ui-text-primary);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #d8dce2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: var(--ui-transition);
}

.btn-ui-secondary:hover {
  border-color: #cbd5e1;
  background: #f8f9fa;
  color: var(--ui-text-primary);
}

/* PRIMARY NAVIGATION */
.ui-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--ui-border);
  z-index: 1010;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ui-top-bar.scrolled {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.top-bar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ui-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-text-primary);
}

.ui-brand-mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ui-blue);
  border-radius: 4px;
  background: var(--ui-blue-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ui-blue);
}

.ui-brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ui-text-primary);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.top-links a {
  font-size: 0.84rem;
  color: var(--ui-text-muted);
  font-weight: 500;
}

.top-links a:hover,
.top-links a.active {
  color: var(--ui-text-primary);
}

.top-right-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-right-group a {
  font-size: 0.84rem;
  color: var(--ui-text-muted);
}

.top-right-group a:hover,
.top-right-group a.active {
  color: var(--ui-text-primary);
}

/* SECONDARY STICKY SUB-NAV */
.ui-sub-nav {
  position: sticky;
  top: 52px;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(251, 252, 253, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ui-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.sub-nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ui-text-primary);
}

.sub-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sub-nav-links::-webkit-scrollbar {
  display: none;
}

.sub-nav-link {
  font-size: 0.8125rem;
  color: var(--ui-text-muted);
  padding: 14px 0;
  position: relative;
  white-space: nowrap;
}

.sub-nav-link:hover {
  color: var(--ui-text-primary);
}

.sub-nav-link.active {
  color: var(--ui-text-primary);
  font-weight: 600;
}

.sub-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ui-blue);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  width: 20px;
  height: 1.5px;
  background: var(--ui-text-primary);
}

/* CARDS & GRIDS */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.cap-card {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: var(--ui-transition);
}

.cap-card:hover {
  border-color: rgba(1, 147, 215, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.cap-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--ui-blue-subtle);
  border: 1px solid rgba(1, 147, 215, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-blue);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.cap-card h4 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ui-text-primary);
  margin-bottom: 8px;
}

.cap-card p {
  color: var(--ui-text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.cap-metric-tag {
  font-family: var(--ui-font-mono);
  font-size: 0.75rem;
  color: var(--ui-text-dim);
  padding: 4px 8px;
  background: #f4f5f8;
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  display: inline-block;
}

/* PAGE HEADER (STANDARD FOR INNER PAGES) */
.page-hero {
  padding-top: 100px;
  padding-bottom: 60px;
  background: radial-gradient(circle at 50% 0%, #edf3fa 0%, #ffffff 75%);
  border-bottom: 1px solid var(--ui-border);
}

.page-hero-inner {
  max-width: 840px;
}

.page-hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--ui-text-primary);
  margin-bottom: 18px;
}

.page-hero-desc {
  color: var(--ui-text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* FOOTER */
.ui-footer {
  background: #f8f9fa;
  padding: 80px 0 40px;
  border-top: 1px solid var(--ui-border);
}

.footer-columns {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr) 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--ui-border);
}

.footer-brand-desc {
  color: var(--ui-text-muted);
  font-size: 0.8125rem;
  max-width: 300px;
  line-height: 1.6;
  margin-top: 14px;
}

.footer-col-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ui-text-primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-link-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-stack a {
  font-size: 0.8125rem;
  color: var(--ui-text-muted);
}

.footer-link-stack a:hover {
  color: var(--ui-blue);
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--ui-text-muted);
  margin-bottom: 8px;
}

.footer-contact-item i {
  color: var(--ui-blue);
  font-size: 0.8rem;
}

.footer-legal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  font-size: 0.75rem;
  color: var(--ui-text-dim);
}

.legal-links {
  display: flex;
  gap: 20px;
}

.legal-links a:hover {
  color: var(--ui-blue);
}

/* MOBILE MENU & MODALS */
.mob-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
}

.mob-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mob-menu {
  position: fixed;
  top: 0;
  right: -280px;
  bottom: 0;
  width: 280px;
  background: #ffffff;
  border-left: 1px solid var(--ui-border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  padding: 60px 24px 24px;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mob-menu.open {
  right: 0;
}

.mob-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--ui-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.mob-menu a {
  display: block;
  padding: 12px 0;
  color: var(--ui-text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ui-border);
}

.mob-menu a:hover {
  color: var(--ui-blue);
}

/* SCROLL TO TOP */
#stop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 990;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: var(--ui-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--ui-transition);
}

#stop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#stop:hover {
  border-color: var(--ui-blue);
  color: var(--ui-blue);
  box-shadow: 0 4px 12px rgba(1, 147, 215, 0.18);
}

/* SCROLL REVEAL MOTION */
.ui-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .ui-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .capability-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .top-links,
  .top-right-group {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .section-wrap {
    padding: 70px 0;
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }
}
