:root {
  --navy: #0b2d72;
  --blue: #0992c2;
  --sea: #0ac4e0;
  --beige: #f6e7bc;
}

html {
  scroll-behavior: smooth;
}

body {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(10, 196, 224, 0.14), transparent 42%),
    radial-gradient(circle at 85% 0%, rgba(9, 146, 194, 0.16), transparent 30%),
    radial-gradient(circle at 50% 85%, rgba(246, 231, 188, 0.08), transparent 38%);
}

.header-shape {
  position: absolute;
  inset: auto -8rem -10rem auto;
  width: 20rem;
  height: 20rem;
  background: linear-gradient(135deg, var(--sea), var(--blue));
  opacity: 0.25;
  filter: blur(6px);
  border-radius: 999px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.logo-marquee {
  position: relative;
  display: flex;
  overflow: hidden;
  gap: 1rem;
  padding: 0.35rem 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-track {
  width: max-content;
  min-width: max-content;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: marquee 34s linear infinite;
}

.logo-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(10, 196, 224, 0.28);
  white-space: nowrap;
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.95rem;
}

.logo-chip img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 0.5rem));
  }
}

@media (max-width: 640px) {
  .logo-track {
    animation-duration: 26s;
  }
}

/* ── Language toggle button ── */
.lang-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: 'Cairo', 'Lato', sans-serif;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── RTL / Arabic support ── */
html[dir="rtl"] body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: 'Cairo', 'Changa', sans-serif;
}

html[dir="rtl"] .header-shape {
  inset: auto auto -10rem -8rem;
}

html[dir="rtl"] .list-disc {
  padding-right: 1.25rem;
  padding-left: 0;
}

/* ── Project screenshots grid ── */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.screenshot-thumb-wrap {
  display: block;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: zoom-in;
  background: #1e293b;
  border: 1px solid rgba(100, 116, 139, 0.3);
  transition: border-color 0.2s, transform 0.2s;
}

.screenshot-thumb-wrap:hover {
  border-color: rgba(10, 196, 224, 0.5);
  transform: translateY(-2px);
}

.screenshot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox.hidden {
  display: none;
}

#lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

#lb-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#lb-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

#lb-prev,
#lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#lb-prev { left: 1rem; }
#lb-next { right: 1rem; }

#lb-prev:hover,
#lb-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

#lb-counter {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

/* ── Blog prose typography ── */
.blog-prose > * + * { margin-top: 1.5rem; }

.blog-prose h2 {
  font-family: 'Changa', 'Cairo', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #F6E7BC;
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(10, 196, 224, 0.2);
}

.blog-prose h3 {
  font-family: 'Changa', 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0AC4E0;
  margin-top: 2rem;
}

.blog-prose p { color: #cbd5e1; line-height: 1.9; }

.blog-prose ul,
.blog-prose ol { color: #cbd5e1; padding-left: 1.5rem; }

.blog-prose ul { list-style-type: disc; }
.blog-prose ol { list-style-type: decimal; }
.blog-prose li { margin-bottom: 0.5rem; line-height: 1.75; }

.blog-prose strong { color: #F6E7BC; font-weight: 700; }

.blog-prose a { color: #0AC4E0; text-decoration: underline; }
.blog-prose a:hover { color: #F6E7BC; }

.blog-prose hr {
  border: none;
  border-top: 1px solid rgba(100, 116, 139, 0.3);
  margin: 2rem 0;
}

.blog-prose blockquote {
  border-left: 3px solid #0AC4E0;
  padding-left: 1rem;
  color: #94a3b8;
  font-style: italic;
}

.blog-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  overflow-x: auto;
  display: block;
}

.blog-prose th {
  background: rgba(9, 146, 194, 0.2);
  color: #F6E7BC;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid rgba(100, 116, 139, 0.3);
  white-space: nowrap;
}

.blog-prose td {
  padding: 0.5rem 0.75rem;
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.blog-prose tr:nth-child(even) td { background: rgba(15, 23, 42, 0.5); }

/* RTL blog prose */
html[dir="rtl"] .blog-prose ul,
html[dir="rtl"] .blog-prose ol { padding-left: 0; padding-right: 1.5rem; }

html[dir="rtl"] .blog-prose blockquote {
  border-left: none;
  border-right: 3px solid #0AC4E0;
  padding-left: 0;
  padding-right: 1rem;
}

html[dir="rtl"] .blog-prose th { text-align: right; }
