:root {
  --bg: #ffffff;
  --text: #0b0b0b;
  --muted: #5f6368;
  --line: #e5e7eb;
  --accent: #0f0f0f;
  --surface: #f8f8f8;
  --surface-2: #f3f4f6;
  --pill: #ededed;
  --header-bg: rgba(255, 255, 255, 0.92);
  --particle-color: 0, 0, 0;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

body.theme-dark {
  --bg: #0b0b0d;
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.66);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ffffff;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.08);
  --pill: rgba(255, 255, 255, 0.12);
  --header-bg: rgba(15, 15, 17, 0.92);
  --particle-color: 255, 255, 255;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-dir="rtl"] {
  font-family: "Cairo", "SF Pro Display", sans-serif;
}

.page {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 0 0 80px;
  position: relative;
  z-index: 1;
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(140deg, #ffffff, #dcdcdc 50%, #b9b9b9);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18);
}

body.theme-dark .logo {
  background: linear-gradient(140deg, #ffffff, #bdbdbd 45%, #8a8a8a);
}

.brand-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-tag {
  color: var(--muted);
  font-size: 0.85rem;
}

.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.lang-switch button,
.license-link,
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.lang-switch button.is-active,
.lang-switch button:hover,
.license-link:hover,
.theme-toggle:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: transparent;
}

.hero-cover {
  position: relative;
  height: min(90vh, 720px);
  display: grid;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
  margin: 10px 0 60px;
  box-shadow: var(--shadow);
}

.hero-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-cover__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(255, 255, 255, 0) 100%);
}

.hero-cover__content {
  position: relative;
  z-index: 1;
  padding: 56px;
  max-width: 560px;
  color: #fff;
}

.hero-cover__content h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 12px 0 16px;
}

.hero-cover__content .hero-sub {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn.primary {
  background: #fff;
  color: #000;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  background: transparent;
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-metrics {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.hero-metrics .metric {
  font-size: 1.3rem;
  font-weight: 600;
}

.hero-metrics .label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

section {
  padding: 70px 0 20px;
}

.section-title h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  margin: 14px 0 16px;
}

.section-sub {
  color: var(--muted);
  line-height: 1.7;
  max-width: 720px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.45);
}

body.theme-dark .eyebrow {
  color: rgba(255, 255, 255, 0.55);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.media-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.media-card:hover img {
  transform: scale(1.05);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.product {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.theme-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.theme-fab:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: var(--bg);
}

.project-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.pill {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pill);
  font-size: 0.75rem;
}

.license-cta {
  padding: 60px 0 10px;
}

.license-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.site-footer {
  margin-top: 50px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
}

.js .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-cover {
    height: 70vh;
  }

  .hero-cover__content {
    padding: 36px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .license-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
