/* === Base reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Typography & palette === */
:root {
  --bg: #f4f1eb;
  --text: #2a2a2a;
  --muted: #7a7a6e;
  --accent: #1a0dab;
  --accent-visited: #609;
  --accent-hover: #d1310a;
  --border: #c8c4ba;
  --font-mono: "Courier New", Courier, monospace;
  --font-serif: Georgia, "Times New Roman", Times, serif;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

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

/* === Layout === */
.container {
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* === Header === */
header {
  margin-bottom: 1.5rem;
}

header h1 {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

nav {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.home-link {
  color: inherit;
  text-decoration: none;
}

.home-link:visited {
  color: inherit;
}

.home-link:hover {
  color: var(--accent-hover);
}

nav a {
  color: var(--accent);
  text-decoration: none;
}

nav a.active {
  color: var(--text);
  text-decoration: none;
  cursor: default;
}

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

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

.sep {
  color: var(--muted);
  margin: 0 0.3rem;
}

/* === Sections === */
section {
  margin: 2rem 0;
}

h2 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text);
}

h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.proof {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  background: #eae7df;
  border-left: 3px solid var(--border);
  padding: 0.8rem 1rem;
  margin: 0.5rem 0;
  overflow-x: auto;
}

.proof-label {
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

.proof-gloss {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

p {
  margin-bottom: 0.8rem;
  color: var(--text);
}

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

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

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

/* === Dividers === */
.divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0;
}

/* === Footer === */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

footer p {
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.counter {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

/* === Selection color (a subtle 90s touch) === */
::selection {
  background: #ffe066;
  color: var(--text);
}

/* === Responsive === */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .container {
    margin: 1.5rem auto;
  }
}
