:root {
  --color-light-lavender: #f5f0fa;
  --color-ink: #302738;
  --color-muted: #6c6077;
  --color-line: #e0d5eb;
  --color-purple: #642b87;
  --color-violet: #7b439d;
  --color-white: #ffffff;
  --radius: 24px;
  --shadow: 0 4px 16px rgba(100, 43, 135, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--color-light-lavender);
  color: var(--color-ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
}

html[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: normal;
}

.site-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  background-color: var(--color-light-lavender);
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--color-purple);
  text-decoration: none;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.language-toggle {
  background: transparent;
  border: 1px solid var(--color-line);
  color: var(--color-muted);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-toggle:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

.language-toggle:hover {
  background-color: var(--color-light-lavender);
  color: var(--color-purple);
  border-color: var(--color-purple);
}

.demo-link {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-purple), var(--color-violet));
  color: var(--color-white);
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-link:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

.demo-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

main.article-shell {
  max-width: 808px;
  margin: 0 auto;
  padding: 40px 24px;
}

.hero {
  margin-bottom: 48px;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-purple);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--color-ink);
  font-weight: 800;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 48px;
}

.metric {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.metric strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--color-purple);
  margin-bottom: 8px;
}

.metric span {
  display: block;
  font-size: 14px;
  color: var(--color-muted);
}

.article-body {
  font-size: 18px;
  line-height: 1.8;
}

html[dir="rtl"] .article-body {
  line-height: 2;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--color-ink);
}

.article-body p {
  margin-bottom: 20px;
}

.article-body .fine-print {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-muted);
  margin-top: -8px;
}

.article-body .fine-print small { font-size: inherit; }
.article-body .fine-print:lang(ar) { font-size: 15px; line-height: 1.9; }

.table-scroll {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius);
}

table {
  direction: ltr;
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
}

th {
  font-weight: 700;
  color: var(--color-ink);
  background: linear-gradient(90deg, rgba(100, 43, 135, 0.05) 0%, rgba(123, 67, 157, 0.05) 100%);
}

th[dir="rtl"] {
  text-align: right;
}

td {
  color: var(--color-ink);
  font-size: 16px;
}

tbody tr:first-child {
  background: linear-gradient(135deg, #f7edfd, #ecdff8);
  font-weight: 600;
}

.article-body a { color: var(--color-purple); text-underline-offset: 3px; }
html[dir="rtl"] .eyebrow { letter-spacing: normal; }
html[dir="rtl"] .hero h1 { line-height: 1.6; }
.language-toggle { font-family: 'DM Sans', 'Noto Sans Arabic', sans-serif; min-height: 44px; }
.table-scroll table { min-width: 580px; font-family: 'DM Sans', system-ui, -apple-system, sans-serif; line-height: 1.6; }

caption {
  caption-side: top;
  text-align: left;
  padding: 16px;
  font-weight: 700;
  color: var(--color-ink);
}

caption:dir(rtl) {
  text-align: right;
}

.closing-cta {
  text-align: center;
  margin: 64px 24px 40px;
}

.closing-cta h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--color-ink);
}

.closing-cta p {
  font-size: 18px;
  color: var(--color-muted);
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

footer {
  border-top: 1px solid var(--color-line);
  padding: 32px 24px;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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

  .site-header {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 375px) {
  body {
    font-size: 15px;
  }

  main.article-shell {
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 24px;
  }

  th, td {
    padding: 12px 14px;
    font-size: 14px;
  }

  [data-table="fixed-width"] {
    min-width: 500px;
  }
}

:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Preserve the complete artwork at every viewport width. */
.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 28px;
  border-radius: 16px;
}
