/* ===== Tokens (matches the Beder app's dark theme) ===== */
:root {
  --bg: #000000;
  --card: #121212;
  --card-alt: #1A1A1A;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #A855F7;
  --accent-2: #EC4899;
  --text: #FFFFFF;
  --text-secondary: #CCCCCC;
  --text-muted: #999999;
  --text-faint: #666666;
  --danger: #FF6B6B;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-w: 760px;
  --edge: 20px;
}

* , *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--edge);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-word {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.86rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.lang-btn {
  min-width: 34px;
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.lang-btn:not(.is-active):hover {
  background: var(--card-alt);
  color: var(--text);
}

/* ===== Main content ===== */
main {
  padding-block: 40px 80px;
}

/* Home / hero */
.hero {
  text-align: center;
  padding-block: 36px 44px;
}

.hero-mark {
  width: 84px;
  height: 84px;
  margin-inline: auto;
  margin-block-end: 20px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgba(168, 85, 247, 0.55);
}

.hero-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p {
  max-width: 46ch;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 1rem;
}

.link-cards {
  display: grid;
  gap: 12px;
  margin-block-start: 36px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: background 0.15s ease, transform 0.15s ease;
}

.link-card:hover {
  background: var(--card-alt);
  transform: translateY(-1px);
}

.link-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.link-card-sub {
  display: block;
  margin-block-start: 2px;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-weight: 400;
}

.link-card-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-note {
  margin-block-start: 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.86rem;
}

.contact-note a {
  color: var(--accent);
}

/* ===== Legal document pages ===== */
.doc-header {
  margin-block-end: 28px;
}

.doc-header h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.last-updated {
  color: var(--text-faint);
  font-size: 0.8rem;
}

.doc-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-block-end: 30px;
  padding-block-end: 24px;
  border-bottom: 1px solid var(--line);
}

.doc-section {
  margin-block-end: 26px;
}

.doc-section h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-block-end: 12px;
}

.doc-section p:last-child { margin-block-end: 0; }

.doc-section ul,
.doc-section ol {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-block-end: 12px;
  padding-inline-start: 22px;
}

.doc-section ul { list-style: disc; }
.doc-section ol { list-style: decimal; }

.doc-section li { margin-block-end: 6px; }
.doc-section li:last-child { margin-block-end: 0; }

.doc-section a { color: var(--accent); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--text); }

/* ===== Responsive ===== */
@media (max-width: 560px) {
  :root { --edge: 18px; }
  .nav-group { width: 100%; justify-content: space-between; }
  .site-nav { gap: 14px; font-size: 0.8rem; }
  .hero h1 { font-size: 1.6rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ===== RTL (Arabic) ===== */
html[dir="rtl"] body {
  line-height: 1.7;
}

[dir="rtl"] .link-card-arrow {
  transform: scaleX(-1);
}

/* ===== Accessibility ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
