/* Base */
:root {
  --bg: #071b2b;
  --bg-2: #0b2d46;
  --brand: #18d0d1;
  --brand-2: #21a56b;
  --accent: #ffb23f;
  --text: #f4fbff;
  --muted: rgba(244, 251, 255, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(33, 165, 107, 0.22), transparent 28%),
    radial-gradient(circle at 20% 10%, rgba(24, 208, 209, 0.18), transparent 22%),
    linear-gradient(180deg, #05131f 0%, #071b2b 38%, #04121d 100%);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.08;
  pointer-events: none;
}

.container-max {
  width: min(1120px, calc(100% - 2rem));
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.glass-dark {
  background: linear-gradient(180deg, rgba(11, 26, 43, 0.92), rgba(4, 14, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.section-title {
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.nav-link {
  position: relative;
  transition: color 180ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -0.45rem;
  height: 2px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
}

.nav-link.is-active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.button-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #03131e;
  box-shadow: 0 16px 34px rgba(24, 208, 209, 0.28);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-primary,
.button-secondary {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button-primary:hover,
.button-secondary:hover {
  transform: translateY(-2px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(circle at top left, rgba(24, 208, 209, 0.28), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 178, 63, 0.26), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
  z-index: -1;
}

.float-slow {
  animation: floatSlow 7s ease-in-out infinite;
}

.float-medium {
  animation: floatMedium 5s ease-in-out infinite;
}

.float-fast {
  animation: floatFast 4.5s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes floatMedium {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes floatFast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

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

.counter {
  font-variant-numeric: tabular-nums;
}

.device-frame {
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.soft-ring {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 40px rgba(24, 208, 209, 0.18);
}

.tab-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.tab-pill.is-active {
  background: rgba(24, 208, 209, 0.16);
  border-color: rgba(24, 208, 209, 0.3);
}

.section-divider {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.article-copy p + p {
  margin-top: 1rem;
}

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

  .float-slow,
  .float-medium,
  .float-fast,
  .reveal {
    animation: none !important;
    transition: none !important;
  }
}
