/* ============================================================
   COMPONENTS.CSS — Header, Hero, Sections, Cards, Table, Footer
   Klyo — The Enterprise AI Security Gateway
   ============================================================ */

/* ==========================================================
   HEADER / NAVIGATION
   ========================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  transition: border-color var(--transition-base),
    background var(--transition-base);
}

.site-header.scrolled {
  border-bottom-color: var(--header-border-scrolled);
  background: var(--header-bg-scrolled);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  flex-shrink: 0;
}

/* Nav */
.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link:hover::after {
  width: 100%;
}

/* Header toggles (dark mode + nerd + lang) */
.header-toggles {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: var(--space-md);
}

[dir="rtl"] .header-toggles {
  margin-left: 0;
  margin-right: var(--space-md);
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.toggle-btn:hover {
  color: var(--color-primary);
  background: var(--badge-bg);
}

.toggle-btn.active {
  color: var(--color-primary);
  background: var(--badge-bg);
  border-color: var(--color-primary);
}

/* Sun/moon icon switching */
.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.nerd-label {
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
}


/* ==========================================================
   LANGUAGE SWITCHER
   ========================================================== */
.lang-switcher {
  position: relative;
}

.lang-toggle {
  gap: 0.3em !important;
}

.lang-current {
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.lang-chevron {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.lang-dropdown.open ~ .lang-toggle .lang-chevron,
.lang-toggle[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast),
    visibility var(--transition-fast);
  z-index: 1100;
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.55em 0.75em;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

[dir="rtl"] .lang-option {
  text-align: right;
}

.lang-option:hover {
  background: var(--badge-bg);
}

.lang-option.active {
  color: var(--color-primary);
  font-weight: 600;
}

.lang-option.active::after {
  content: '\2713';
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-primary);
}

[dir="rtl"] .lang-option.active::after {
  margin-left: 0;
  margin-right: auto;
}

.lang-flag {
  font-size: 1.15em;
  line-height: 1;
}


/* ==========================================================
   FOOTER SOCIAL
   ========================================================== */
.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.45);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.social-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 1001;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.menu-toggle.active .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ==========================================================
   HERO
   ========================================================== */
.hero {
  padding-top: calc(var(--header-height) + var(--space-4xl));
  padding-bottom: var(--space-5xl);
  background: linear-gradient(
    170deg,
    var(--color-bg) 0%,
    var(--color-bg-alt) 50%,
    rgba(120, 41, 95, 0.03) 100%
  );
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--badge-color);
  background: var(--badge-bg);
  padding: 0.4em 1.2em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.hero-title {
  font-size: var(--text-5xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-xl);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.hero-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
}

/* Hero gateway diagram */
.hero-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gateway-diagram {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.gw-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.gw-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gw-klyo {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  padding: var(--space-xl) var(--space-2xl);
}

.gw-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.gw-label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.gw-sublabel {
  font-size: var(--text-xs);
  opacity: 0.8;
  margin-top: 0.25rem;
}

.gw-arrow {
  width: 32px;
  height: 2px;
  background: var(--color-border-strong);
  position: relative;
  flex-shrink: 0;
}

.gw-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: solid var(--color-border-strong);
  border-width: 0 2px 2px 0;
  padding: 4px;
  transform: rotate(-45deg);
}

/* --- Hero Gateway Animations --- */

/* Pulsing glow on Klyo center node */
.gw-klyo {
  animation: klyo-pulse 3s ease-in-out infinite;
}

@keyframes klyo-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(120, 41, 95, 0.25); }
  50%      { box-shadow: 0 0 32px rgba(120, 41, 95, 0.45), 0 0 56px rgba(120, 41, 95, 0.15); }
}

[data-theme="dark"] .gw-klyo {
  animation-name: klyo-pulse-dark;
}

@keyframes klyo-pulse-dark {
  0%, 100% { box-shadow: 0 0 16px rgba(184, 93, 154, 0.3); }
  50%      { box-shadow: 0 0 32px rgba(184, 93, 154, 0.5), 0 0 56px rgba(184, 93, 154, 0.2); }
}

/* Data flow particle along arrows */
.gw-arrow::before {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  top: -1.5px;
  animation: data-flow 2.2s ease-in-out infinite;
}

@keyframes data-flow {
  0%   { left: -5px;  opacity: 0; }
  15%  { opacity: 0.8; }
  85%  { opacity: 0.8; }
  100% { left: calc(100% + 5px); opacity: 0; }
}

/* Subtle floating on outer nodes */
.gw-employee { animation: gw-float 4s ease-in-out infinite; }
.gw-ai       { animation: gw-float 4s ease-in-out infinite 0.5s; }

@keyframes gw-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Pause float on hover for clean interaction */
.gw-employee:hover,
.gw-ai:hover {
  animation-play-state: paused;
}

/* Staggered entrance */
.gateway-diagram .gw-node,
.gateway-diagram .gw-arrow {
  opacity: 0;
  animation: gw-entrance 0.6s ease-out forwards;
}

.gateway-diagram .gw-employee      { animation: gw-entrance 0.6s ease-out 0.3s forwards, gw-float 4s ease-in-out 1.5s infinite; }
.gateway-diagram .gw-arrow:first-of-type { animation-delay: 0.6s; }
.gateway-diagram .gw-klyo          { animation: gw-entrance 0.6s ease-out 0.9s forwards, klyo-pulse 3s ease-in-out 1.8s infinite; }
.gateway-diagram .gw-arrow:last-of-type  { animation-delay: 1.2s; }
.gateway-diagram .gw-ai            { animation: gw-entrance 0.6s ease-out 1.5s forwards, gw-float 4s ease-in-out 2.2s infinite 0.5s; }

[data-theme="dark"] .gateway-diagram .gw-klyo {
  animation: gw-entrance 0.6s ease-out 0.9s forwards, klyo-pulse-dark 3s ease-in-out 1.8s infinite;
}

@keyframes gw-entrance {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==========================================================
   STATS GRID (Problem section)
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  display: block;
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
}


/* ==========================================================
   ARCHITECTURE FLOW (Solution section)
   ========================================================== */
.architecture {
  margin-bottom: var(--space-3xl);
}

.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.arch-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-sm);
  min-width: 140px;
}

.arch-box small {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.arch-box-primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.arch-box-primary small {
  opacity: 0.8;
  color: #ffffff;
}

.arch-box-secondary {
  background: var(--color-bg-alt);
  border-color: var(--color-border-strong);
}

.arch-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.arch-connector {
  color: var(--color-text-faint);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.arch-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--color-text-faint);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.arch-audit {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text-faint);
}


/* ==========================================================
   CAPABILITIES GRID (Solution section)
   ========================================================== */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.cap-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.cap-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.cap-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--badge-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.cap-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.cap-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.cap-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}


/* ==========================================================
   BENEFITS (Why Klyo section)
   ========================================================== */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.benefit-block {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.benefit-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.benefit-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
}

.benefit-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}

.benefit-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.benefit-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}


/* ==========================================================
   MARKET SECTION
   ========================================================== */
.market-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.market-stat {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: linear-gradient(135deg, rgba(120, 41, 95, 0.04), rgba(16, 185, 129, 0.04));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.market-number {
  display: block;
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.market-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}


/* Products section */
.product-showcase {
  max-width: 860px;
  margin-inline: auto;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Featured product card — powerful look */
.product-card-featured {
  text-align: center;
  align-items: center;
  padding: 0;
  background: linear-gradient(135deg, var(--color-primary), #10b981 50%, var(--color-primary));
  border: none;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(120, 41, 95, 0.12),
    0 0 0 1px rgba(120, 41, 95, 0.08);
}

/* Inner container creates the "border" effect */
.product-card-inner {
  background: var(--color-bg-card);
  border-radius: 18px;
  margin: 2px;
  padding: var(--space-3xl) var(--space-2xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Accent glow bar at top */
.product-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-primary), #10b981, var(--color-primary), transparent);
}

/* Background ambient glow */
.product-card-inner::after {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(120, 41, 95, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .product-card-inner::after {
  background: radial-gradient(ellipse, rgba(184, 93, 154, 0.08) 0%, transparent 70%);
}

.product-card-featured:hover {
  transform: translateY(-6px);
  box-shadow:
    0 24px 64px rgba(120, 41, 95, 0.2),
    0 0 48px rgba(120, 41, 95, 0.08);
}

[data-theme="dark"] .product-card-featured {
  box-shadow:
    0 8px 32px rgba(120, 41, 95, 0.2),
    0 0 0 1px rgba(120, 41, 95, 0.15);
}

[data-theme="dark"] .product-card-featured:hover {
  box-shadow:
    0 24px 64px rgba(120, 41, 95, 0.35),
    0 0 56px rgba(120, 41, 95, 0.15);
}

.product-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.product-card-featured .product-card-header {
  flex-direction: column;
  text-align: center;
}

.product-status {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35em 1em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xs);
}

.product-card-enterprise .product-status {
  background: linear-gradient(135deg, rgba(120, 41, 95, 0.15), rgba(16, 185, 129, 0.1));
  color: var(--badge-color);
  border: 1px solid rgba(120, 41, 95, 0.2);
}

[data-theme="dark"] .product-card-enterprise .product-status {
  background: linear-gradient(135deg, rgba(184, 93, 154, 0.2), rgba(16, 185, 129, 0.12));
  border-color: rgba(184, 93, 154, 0.3);
}

/* Icon — larger with glow */
.product-icon-wrap {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary), #9a3d7a);
  box-shadow: 0 8px 24px rgba(120, 41, 95, 0.25);
  animation: product-icon-glow 3s ease-in-out infinite;
}

@keyframes product-icon-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(120, 41, 95, 0.25); }
  50%      { box-shadow: 0 8px 32px rgba(120, 41, 95, 0.4), 0 0 48px rgba(120, 41, 95, 0.12); }
}

.product-icon {
  width: 32px;
  height: 32px;
  color: #ffffff;
}

.product-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.product-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  max-width: 620px;
}

/* Divider before features */
.product-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg) var(--space-2xl);
  margin-bottom: var(--space-2xl);
  text-align: left;
  width: 100%;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

[dir="rtl"] .product-features-grid {
  text-align: right;
}

.product-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-features li {
  position: relative;
  padding-left: 2em;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.product-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 0;
  width: 1.4em;
  height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 800;
  color: #ffffff;
  background: #10b981;
  border-radius: 50%;
  text-align: center;
  line-height: 1.4em;
}

/* CTA button — larger in product card */
.product-card-featured .btn-primary {
  padding: 1em 3em;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
}

[dir="rtl"] .product-features li {
  padding-left: 0;
  padding-right: 2em;
}
[dir="rtl"] .product-features li::before {
  left: auto;
  right: 0;
}


/* Comparison table */
.comparison-wrap {
  max-width: 900px;
  margin-inline: auto;
}

.comparison-title {
  text-align: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xl);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.comparison-table {
  min-width: 600px;
}

.comparison-table th,
.comparison-table td {
  padding: 0.9rem 1.2rem;
  text-align: center;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  background: var(--color-bg-alt);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.comparison-table td:first-child,
.comparison-table th:first-child {
  text-align: left;
  font-weight: 500;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--color-bg-alt);
}

.highlight-col {
  background: var(--highlight-bg) !important;
}

.comparison-table th.highlight-col {
  color: var(--color-primary);
  background: var(--highlight-bg-strong) !important;
}

.check {
  color: var(--color-check);
  font-weight: 700;
  font-size: var(--text-lg);
}

.cross {
  color: var(--color-cross);
  font-weight: 700;
  font-size: var(--text-lg);
}

.partial {
  color: var(--color-partial);
  font-weight: 700;
  font-size: var(--text-lg);
}


/* ==========================================================
   CTA SECTION
   ========================================================== */
.section-cta {
  background: var(--cta-bg);
  color: #ffffff;
  padding: var(--space-4xl) 0;
  padding-bottom: var(--space-5xl);
  margin-bottom: -1px; /* prevent subpixel gap */
}

.cta-inner {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

.cta-title {
  font-size: var(--text-3xl);
  color: #ffffff;
  margin-bottom: var(--space-md);
}

.cta-text {
  font-size: var(--text-lg);
  opacity: 0.85;
  margin-bottom: var(--space-xl);
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}


/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--space-4xl) 0 var(--space-xl);
  position: relative;
  overflow: hidden;
}

/* Smooth gradient blending CTA into footer */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(
    to bottom,
    var(--color-brand-deep),
    var(--footer-bg)
  );
  pointer-events: none;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-3xl);
  padding-bottom: var(--space-2xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-brand .logo {
  margin-bottom: var(--space-xs);
}

.footer-description {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  line-height: var(--leading-normal);
}

.footer-description-sm {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.4);
  margin-top: var(--space-xs);
}

.footer-nav {
  display: flex;
  gap: var(--space-3xl);
  justify-content: flex-end;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: var(--space-md);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-col a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.03em;
}


/* ==========================================================
   FAQ SECTION
   ========================================================== */
.faq-list {
  max-width: 800px;
  margin-inline: auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
  border-top: 1px solid var(--color-border);
}

.faq-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: var(--space-md);
  color: var(--color-text);
}

.faq-question {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: var(--leading-snug);
}

.faq-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-text-muted);
  transition: transform var(--transition-base), color var(--transition-base);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--color-primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow) ease;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer p {
  padding-bottom: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}


/* ==========================================================
   CONTACT FORM (inside CTA section)
   ========================================================== */
.contact-form {
  max-width: 560px;
  margin-inline: auto;
  margin-top: var(--space-xl);
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.75em 1em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-submit {
  width: 100%;
  margin-top: var(--space-sm);
}

/* Success state */
.contact-success {
  text-align: center;
  animation: success-entrance 0.5s ease-out;
}

.success-icon {
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.success-icon svg {
  display: inline-block;
}

.success-title {
  font-size: var(--text-2xl);
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.success-text {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-xl);
}

@keyframes success-entrance {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==========================================================
   COOKIE CONSENT BANNER
   ========================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: var(--space-lg) 0;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.cookie-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  flex: 1;
}

.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

[data-theme="dark"] .cookie-banner {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}


/* ==========================================================
   RTL (RIGHT-TO-LEFT) SUPPORT — Arabic
   ========================================================== */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Section headers stay centered */
[dir="rtl"] .section-header {
  text-align: center;
}

[dir="rtl"] .hero-inner {
  text-align: right;
}

/* Gateway diagram arrow flipping */
[dir="rtl"] .gw-arrow::after {
  right: auto;
  left: -1px;
  transform: rotate(135deg);
}

/* Architecture connectors */
[dir="rtl"] .arch-connector svg {
  transform: scaleX(-1);
}

/* Nav underline */
[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

/* Nerd blocks: keep English technical content LTR */
[dir="rtl"] .nerd-block .nerd-content {
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .nerd-inline {
  direction: ltr;
  text-align: left;
}

/* Nerd mode list markers */
[dir="rtl"] .nerd-col li {
  padding-left: 0;
  padding-right: 1em;
}

[dir="rtl"] .nerd-col li::before {
  left: auto;
  right: 0;
  content: '<';
}

/* Comparison table first column */
[dir="rtl"] .comparison-table td:first-child,
[dir="rtl"] .comparison-table th:first-child {
  text-align: right;
}

/* Footer nav */
[dir="rtl"] .footer-nav {
  justify-content: flex-start;
}

/* Benefit block layout */
[dir="rtl"] .benefit-block {
  direction: rtl;
}

/* CTA centered stays centered */
[dir="rtl"] .cta-inner {
  text-align: center;
}

/* FAQ */
[dir="rtl"] .faq-toggle {
  text-align: right;
}

/* Contact form */
[dir="rtl"] .contact-form {
  text-align: right;
}

/* Data flow arrow direction reversed */
[dir="rtl"] .gw-arrow::before {
  animation-name: data-flow-rtl;
}

@keyframes data-flow-rtl {
  0%   { right: -5px;  left: auto; opacity: 0; }
  15%  { opacity: 0.8; }
  85%  { opacity: 0.8; }
  100% { right: calc(100% + 5px); left: auto; opacity: 0; }
}
