/* ─── Design tokens ─────────────────────────────────────────────────────── */

:root {
  --color-bg:      #ffffff;
  --color-text:    #1a1a1a;
  --color-muted:   #6b7280;
  --color-accent:  #2563eb;
  --color-border:  #e5e7eb;

  --font-body:  system-ui, sans-serif;
  --font-mono:  ui-monospace, monospace;

  --size-content: 680px;
  --space:        1.5rem;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

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

/* ─── Base ───────────────────────────────────────────────────────────────── */

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;  /* 17px */
  line-height: 1.7;
  padding: var(--space);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

header, main, footer {
  max-width: var(--size-content);
  margin-inline: auto;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

header {
  display: flex;
  align-items: baseline;
  padding-block: var(--space);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: calc(var(--space) * 2);
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

nav {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

nav a:hover {
  color: var(--color-accent);
}

/* ─── Main content ───────────────────────────────────────────────────────── */

main {
  padding-block: var(--space);
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.375rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p  { margin-bottom: 1rem; }

a {
  color: var(--color-accent);
}

blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
  color: var(--color-muted);
  margin-block: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.25rem;
}

/* ─── Section list ───────────────────────────────────────────────────────── */

.section-list ul {
  list-style: none;
  padding: 0;
}

.section-list li {
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.section-list li a {
  font-weight: 500;
  text-decoration: none;
}

.section-list li a:hover {
  text-decoration: underline;
}

/* ─── Language switcher ──────────────────────────────────────────────────── */

.lang-switcher {
  margin-left: auto;
  position: relative;
}

.lang-dropdown summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted);
  user-select: none;
}

.lang-dropdown summary::-webkit-details-marker { display: none; }

.lang-dropdown ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
  min-width: 3.5rem;
  z-index: 10;
}

.lang-dropdown li a {
  display: block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
}

.lang-dropdown li a:hover {
  color: var(--color-accent);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
  margin-top: calc(var(--space) * 3);
  padding-top: var(--space);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
}
