:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --border: #e5e7eb;
  --selection: #bfdbfe;
  --muted: #666;

  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #ededed;
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --border: #262626;
    --selection: #1e3a8a;
    --muted: #888;
  }
}

* {
  box-sizing: border-box;
}

::selection {
  background-color: var(--selection);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
}

/* --- language switcher --- */

.lang-switcher {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 0 24px;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.lang-link {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: color 0.2s ease;
}

.lang-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.lang-link.active {
  color: var(--text);
  pointer-events: none;
}

/* --- content --- */

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 20px 24px;
  opacity: 0;
  animation: riseIn 0.8s ease forwards;
}

.content[dir='rtl'] {
  text-align: right;
}

.content[dir='rtl'] ul {
  padding-left: 0;
  padding-right: 2em;
}

.content h1 {
  margin-top: 2em;
  margin-bottom: 1em;
  font-size: 2.25em;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
}

.content ul {
  padding-left: 2em;
}

.content li {
  margin-bottom: 0.5em;
}

.content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.content a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

.content img {
  max-width: 100%;
  border-radius: 8px;
}

/* --- footer --- */

.footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 80px 24px;
  font-size: 0.85em;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 0.8s ease 0.2s forwards;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
