/* ========================================
   BISHENG Lab — Google Labs–inspired Design
   Light background + Sci-fi Blue accents
   ======================================== */

:root {
  /* Colors — Light theme with blue sci-fi accents */
  --bg-main: #f0f4ff;
  --bg-white: #ffffff;
  --blue-50: #eef4ff;
  --blue-100: #dce8ff;
  --blue-200: #b8d4ff;
  --blue-300: #7ab4ff;
  --blue-400: #4d9fff;
  --blue-500: #0080ff;
  --blue-600: #0066d6;
  --blue-glow: rgba(0, 128, 255, 0.25);
  --text-primary: #0a0f1e;
  --text-secondary: #4a5578;
  --text-tertiary: #7a84a0;

  /* Card accent colors (Google Labs–style distinct tints per card) */
  --card-blue: #d8e8ff;
  --card-violet: #e4dcff;
  --card-cyan: #d0f0f8;
  --card-mint: #d4f5e4;
  --card-rose: #ffe0ec;
  --card-amber: #fff2d8;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Borders */
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 100px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Canvas Background --- */
#crystal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =====================
   NAVBAR
   ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-lg);
  transition: background 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
}

.navbar.scrolled {
  background: rgba(240, 244, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links-left,
.nav-links-right {
  flex: 1;
  display: flex;
}

.nav-links-left {
  justify-content: flex-start;
}

.nav-links-right {
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: background 0.25s var(--ease-smooth);
}

.nav-link:hover {
  background: rgba(0, 128, 255, 0.08);
}

/* --- Language Switcher --- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 128, 255, 0.06);
  border-radius: var(--radius-pill);
}

.lang-option {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  white-space: nowrap;
}

.lang-option:hover {
  color: var(--text-primary);
}

.lang-option.active {
  background: var(--bg-white);
  color: var(--blue-500);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 32px;
  max-height: 32px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s var(--ease-smooth);
}

.logo:hover .logo-img {
  transform: scale(1.04);
}

/* =====================
   HERO SECTION
   ===================== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 140px var(--space-lg) var(--space-xl);
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-smooth) 0.1s forwards;
}

.hero-highlight {
  color: var(--blue-500);
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-weight: 400;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-smooth) 0.3s forwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* =====================
   FEATURED CARD
   ===================== */
.featured {
  position: relative;
  z-index: 1;
  padding: 0 var(--space-lg) var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.featured-card {
  display: flex;
  align-items: stretch;
  background: var(--card-blue);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 360px;
  transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-smooth) 0.5s forwards;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 128, 255, 0.1);
}

.featured-left {
  flex: 1;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.featured-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  line-height: 1.15;
}

.featured-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 400px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth);
  width: fit-content;
}

.pill-btn:hover {
  background: var(--text-primary);
  color: var(--bg-white);
}

.featured-right {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Abstract hexagonal visual in featured card */
.featured-visual {
  width: 100%;
  height: 100%;
  position: relative;
}

.visual-hex-grid {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hex {
  position: absolute;
  width: 120px;
  height: 120px;
  background: rgba(0, 128, 255, 0.1);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: hexFloat 6s ease-in-out infinite;
}

.hex-1 {
  width: 160px;
  height: 160px;
  background: rgba(0, 128, 255, 0.12);
  top: 20%;
  left: 25%;
  animation-delay: 0s;
}

.hex-2 {
  width: 100px;
  height: 100px;
  background: rgba(0, 128, 255, 0.08);
  top: 15%;
  right: 20%;
  animation-delay: -1s;
}

.hex-3 {
  width: 80px;
  height: 80px;
  background: rgba(0, 128, 255, 0.15);
  bottom: 25%;
  left: 35%;
  animation-delay: -2s;
}

.hex-4 {
  width: 140px;
  height: 140px;
  background: rgba(0, 128, 255, 0.06);
  bottom: 10%;
  right: 15%;
  animation-delay: -3s;
}

.hex-5 {
  width: 60px;
  height: 60px;
  background: rgba(0, 128, 255, 0.18);
  top: 50%;
  left: 15%;
  animation-delay: -4s;
}

@keyframes hexFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-12px) rotate(5deg);
  }
}

/* =====================
   PRODUCTS SECTION
   ===================== */
.products {
  position: relative;
  z-index: 1;
  padding: 0 var(--space-lg) var(--space-2xl);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* --- Products Grid: 2 per row --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* =====================
   PRODUCT CARD
   ===================== */
.product-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-smooth),
    box-shadow 0.4s var(--ease-smooth);
  min-height: 280px;
  position: relative;
}

/* Each card gets a distinct pastel background via data attribute */
.product-card[data-color="blue"] {
  background: var(--card-blue);
}

.product-card[data-color="violet"] {
  background: var(--card-violet);
}

.product-card[data-color="cyan"] {
  background: var(--card-cyan);
}

.product-card[data-color="mint"] {
  background: var(--card-mint);
}

.product-card[data-color="rose"] {
  background: var(--card-rose);
}

.product-card[data-color="amber"] {
  background: var(--card-amber);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}

/* --- Card header with crystal icon --- */
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.crystal-icon {
  color: var(--blue-400);
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}

.product-card:hover .crystal-icon {
  opacity: 1;
  transform: scale(1.1) rotate(-5deg);
}

.card-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  flex-grow: 1;
}

.card-action {
  margin-top: var(--space-lg);
}

.card-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  transition: background 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth);
}

.product-card:hover .card-pill {
  background: var(--text-primary);
  color: var(--bg-white);
}

/* --- Card entrance animation --- */
.product-card {
  opacity: 0;
  transform: translateY(24px);
}

.product-card.visible {
  animation: cardIn 0.55s var(--ease-smooth) forwards;
}

.product-card:nth-child(2).visible {
  animation-delay: 0.1s;
}

.product-card:nth-child(3).visible {
  animation-delay: 0.15s;
}

.product-card:nth-child(4).visible {
  animation-delay: 0.2s;
}

.product-card:nth-child(5).visible {
  animation-delay: 0.25s;
}

.product-card:nth-child(6).visible {
  animation-delay: 0.3s;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

/* =====================
   FOOTER
   ===================== */
.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  opacity: 0.6;
  margin-top: 4px;
  font-family: var(--font-display);
}

/* =====================
   RTL SUPPORT (Arabic)
   ===================== */
[dir="rtl"] .navbar-inner,
[dir="rtl"] .featured-card,
[dir="rtl"] .card-header {
  direction: rtl;
}

[dir="rtl"] .nav-links-left {
  justify-content: flex-end;
}

[dir="rtl"] .nav-links-right {
  justify-content: flex-start;
}

[dir="rtl"] .featured-left {
  text-align: right;
}

[dir="rtl"] .hero {
  direction: rtl;
}

[dir="rtl"] .card-desc,
[dir="rtl"] .featured-desc {
  direction: rtl;
  text-align: right;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    flex-direction: column;
    min-height: auto;
  }

  .featured-right {
    min-height: 200px;
  }

  .hero {
    padding: 120px var(--space-sm) var(--space-lg);
  }

  .navbar {
    padding: var(--space-sm);
  }

  .nav-links-left {
    display: none;
  }

  .nav-links-right {
    gap: 4px;
  }

  .nav-link {
    display: none;
  }

  .featured {
    padding: 0 var(--space-sm) var(--space-lg);
  }

  .products {
    padding: 0 var(--space-sm) var(--space-xl);
  }

  .product-card {
    min-height: 220px;
    padding: var(--space-md);
  }

  .featured-left {
    padding: var(--space-lg);
  }

  .featured-title {
    font-size: 1.8rem;
  }
}