:root {
  --primary: #1E3A8A;
  --turquoise: #06B6D4;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --accent-bg: linear-gradient(135deg, #1E3A8A 0%, #06B6D4 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Home page */
.home {
  text-align: center;
  padding-top: 80px;
}

.logo {
  font-size: 80px;
  margin-bottom: 16px;
}

.home h1 {
  font-size: 48px;
  font-weight: 900;
  background: var(--accent-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.home h1 .en {
  font-size: 28px;
  opacity: 0.85;
  font-weight: 700;
  margin-right: 12px;
}

.tagline {
  font-size: 20px;
  color: var(--muted);
  margin-bottom: 4px;
}

.tagline-en {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 48px;
  direction: ltr;
}

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

.link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.12);
  border-color: var(--turquoise);
}

.link-card .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.link-card .title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.link-card .subtitle {
  font-size: 14px;
  color: var(--muted);
  direction: ltr;
}

footer {
  color: var(--muted);
  font-size: 14px;
  margin-top: 60px;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Doc pages */
.doc {
  background: var(--card);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.doc-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 20px;
  transition: background 0.2s;
}

.back-link:hover {
  background: var(--border);
}

.doc h1 {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}

.doc .updated {
  color: var(--muted);
  font-size: 14px;
}

.doc h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.doc h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
}

.doc p {
  margin-bottom: 14px;
  font-size: 16px;
}

.doc ul, .doc ol {
  margin-bottom: 16px;
  padding-right: 24px;
  padding-left: 24px;
}

.doc li {
  margin-bottom: 8px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}

.doc th, .doc td {
  padding: 12px;
  text-align: start;
  border: 1px solid var(--border);
}

.doc th {
  background: var(--bg);
  font-weight: 700;
}

.doc code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
}

.doc strong { font-weight: 700; }

.doc a {
  color: var(--turquoise);
  text-decoration: none;
  border-bottom: 1px dashed var(--turquoise);
}

.doc a:hover {
  border-bottom-style: solid;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.lang-switcher a {
  padding: 6px 14px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border);
}

.lang-switcher a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* LTR specific for EN pages */
html[lang="en"] {
  direction: ltr;
}

html[lang="en"] .doc h1,
html[lang="en"] .doc h2,
html[lang="en"] .doc h3,
html[lang="en"] .doc p,
html[lang="en"] .doc li {
  text-align: left;
}

/* Mobile */
@media (max-width: 640px) {
  .home { padding-top: 48px; }
  .home h1 { font-size: 36px; }
  .logo { font-size: 64px; }
  .doc { padding: 28px 20px; }
  .doc h1 { font-size: 26px; }
  .doc h2 { font-size: 19px; }
}
