@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ═══════════════════════════════════════════
   Design Tokens
   ═══════════════════════════════════════════ */
:root {
  --bg: #0b0f1a;
  --bg-2: #111827;
  --surface: #1e293b;
  --surface-2: #273449;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-2: #a855f7;
  --accent: #22d3ee;
  --border: rgba(255, 255, 255, .08);
  --glow: rgba(99, 102, 241, .35);
  --glow-2: rgba(168, 85, 247, .25);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: .3s cubic-bezier(.4, 0, .2, 1);
}

/* ═══════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #67e8f9;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

ul {
  list-style: none;
  padding: 0;
}

/* ═══════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════ */
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ═══════════════════════════════════════════
   Navbar
   ═══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 26, .75);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  padding: .35rem .65rem;
  border-radius: 999px;
  transition: all var(--transition);
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

/* ═══════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #1e1b4b 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 50%, rgba(99, 102, 241, .2), transparent),
    radial-gradient(ellipse 500px 350px at 80% 30%, rgba(168, 85, 247, .15), transparent),
    radial-gradient(ellipse 400px 300px at 50% 80%, rgba(34, 211, 238, .1), transparent);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .15);
  padding: .4rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.2rem;
  animation: fadeInDown .6s ease-out;
}

.hero-badge::before {
  content: '✦';
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.85rem);
  font-weight: 900;
  line-height: 1.3;
  max-width: 22ch;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp .7s ease-out;
}

.hero-subtitle {
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: .8rem;
  animation: fadeInUp .8s ease-out .1s both;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  animation: fadeInUp .9s ease-out .2s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat span {
  font-size: .8rem;
  color: var(--text-muted);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 2rem;
  padding: .7rem 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeInUp 1s ease-out .3s both;
  text-decoration: none;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow);
  color: #fff;
}

.hero-image {
  margin-top: 3rem;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .1);
  animation: fadeInUp 1s ease-out .4s both;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
}

/* ═══════════════════════════════════════════
   Sections
   ═══════════════════════════════════════════ */
.section {
  margin: 2rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  animation: fadeInUp .6s ease-out both;
}

.section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 1.1rem;
  flex-shrink: 0;
}

.section-intro {
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* ═══════════════════════════════════════════
   Table of Contents
   ═══════════════════════════════════════════ */
.toc {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
}

.toc h2 {
  font-size: 1.15rem;
}

.toc ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .5rem;
  margin-top: .6rem;
}

.toc li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
}

.toc li a::before {
  content: '›';
  color: var(--primary);
  font-weight: 800;
  font-size: 1.2rem;
}

.toc li a:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

/* ═══════════════════════════════════════════
   Notes / Callouts
   ═══════════════════════════════════════════ */
.note {
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  border-right: 4px solid;
}

.note.info {
  background: rgba(59, 130, 246, .08);
  border-color: #3b82f6;
}

.note.warn {
  background: rgba(245, 158, 11, .08);
  border-color: #f59e0b;
}

.note.success {
  background: rgba(16, 185, 129, .08);
  border-color: #10b981;
}

/* ═══════════════════════════════════════════
   Steps
   ═══════════════════════════════════════════ */
.steps {
  display: grid;
  gap: 1rem;
}

.step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all var(--transition);
}

.step:hover {
  border-color: rgba(99, 102, 241, .3);
  transform: translateX(-4px);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  flex: 0 0 auto;
  box-shadow: 0 4px 15px var(--glow);
}

/* ═══════════════════════════════════════════
   Sites Grid & Cards
   ═══════════════════════════════════════════ */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.site-card {
  position: relative;
  background: rgba(30, 41, 59, .6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all var(--transition);
  overflow: hidden;
}

.site-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--glow-2), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.site-card:hover {
  border-color: rgba(99, 102, 241, .35);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}

.site-card:hover::before {
  opacity: 1;
}

.site-header {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .8rem;
}

.site-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  object-fit: cover;
}

.site-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.site-card .site-url {
  display: block;
  direction: ltr;
  text-align: left;
  font-size: .85rem;
  padding: .5rem .7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: .8rem;
  transition: all var(--transition);
  word-break: break-all;
}

.site-card .site-url:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, .08);
}

.copy-btn {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  padding: .6rem;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: .9rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.copy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, .15));
  opacity: 0;
  transition: opacity var(--transition);
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow);
}

.copy-btn:hover::after {
  opacity: 1;
}

.copy-btn.copied {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 6px 20px rgba(16, 185, 129, .3);
  animation: pulse .4s ease-out;
}

/* ═══════════════════════════════════════════
   Video
   ═══════════════════════════════════════════ */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ═══════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════ */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: .8rem;
  background: var(--bg-2);
  transition: all var(--transition);
}

details:hover {
  border-color: rgba(99, 102, 241, .25);
}

details[open] {
  border-color: rgba(99, 102, 241, .35);
  background: var(--surface-2);
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6rem;
}

summary::before {
  content: '▸';
  color: var(--primary);
  font-size: 1.1rem;
  transition: transform var(--transition);
}

details[open] summary::before {
  transform: rotate(90deg);
}

summary::-webkit-details-marker {
  display: none;
}

details p {
  margin-top: .7rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ═══════════════════════════════════════════
   Social / Contact
   ═══════════════════════════════════════════ */
.social {
  text-align: center;
  background: linear-gradient(160deg, #1e1b4b, #312e81, #1e1b4b) !important;
  border: 1px solid rgba(99, 102, 241, .2) !important;
}

.social h2 {
  justify-content: center;
  color: #fff;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
  margin-top: .5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, .05);
}

.social-links a:hover {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .4);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  color: #fff;
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 2rem 0 2.5rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: .9rem;
}

.footer p+p {
  margin-top: .3rem;
}

/* ═══════════════════════════════════════════
   Back to Top
   ═══════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  box-shadow: 0 6px 20px var(--glow);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--glow);
}

/* ═══════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  h1 {
    max-width: 100%;
  }

  .hero-stats {
    gap: 1.2rem;
  }

  .hero-stat strong {
    font-size: 1.3rem;
  }

  .section {
    padding: 1.3rem 1rem;
  }

  .toc ul {
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .section {
    padding: 1rem .8rem;
    margin: 1rem 0;
  }

  .step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .back-to-top {
    bottom: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
  }
}