:root {
  --bg: #f8fafc;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dce3ec;
  --accent: #2457d6;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top, .home, .entry, footer {
  width: min(760px, calc(100% - 2rem));
  margin-inline: auto;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 750;
  text-decoration: none;
}
.language { font-size: .9rem; text-decoration: none; }

.home { padding: clamp(3rem, 9vw, 6rem) 0; }
.home h1, .entry h1 {
  max-width: 18ch;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.home p, .lead, .definition { max-width: 58ch; color: var(--muted); }

.alphabet {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: .45rem;
  margin-top: 2.5rem;
}
.alphabet a, .pages a {
  display: grid;
  place-items: center;
  min-height: 2.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.alphabet a:hover, .pages a:hover { border-color: var(--accent); color: var(--accent); }

.entry { padding: 3rem 0 4rem; }
.meta { color: var(--accent); font-size: .85rem; font-weight: 700; }
.definition {
  padding: 1.2rem 1.3rem;
  background: var(--paper);
  border-left: 3px solid var(--accent);
}
.entry h2 { margin-top: 2.2rem; font-size: 1.15rem; }
.pages {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: .4rem;
  margin-top: 1rem;
}
.pages a { min-height: 2rem; font-size: .78rem; color: var(--muted); }
.nav { display: flex; gap: 1rem; margin-top: 2rem; }

footer {
  margin-top: auto;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .85rem;
}

@media (max-width: 640px) {
  .alphabet { grid-template-columns: repeat(7, 1fr); }
  .pages { grid-template-columns: repeat(5, 1fr); }
}
