@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

@media screen {
  html {
    background: #f5f1eb;
  }
  body {
    background: white;
    max-width: 42em;
    margin: 3em auto;
    padding: 2.5em 3em;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    position: relative;
  }
}

/* download icons */
.downloads {
  position: absolute;
  top: 1.5em;
  right: 1.5em;
  display: flex;
  gap: 0.8em;
}

.downloads a {
  display: block;
  text-align: center;
  text-decoration: none;
}

.downloads span {
  display: block;
  font-size: 0.65em;
  color: #999;
  margin-top: 0.1em;
  letter-spacing: 0.05em;
}

.downloads img {
  width: 40px;
  height: auto;
  opacity: 0.7;
}

.downloads a:hover img {
  opacity: 1;
}

.downloads a:hover span {
  color: #555;
}

body {
  font: 13pt/1.55 'Crimson Text', 'Georgia', serif;
  color: #1a1a1a;
  hyphens: auto;
}

h1 {
  font: 2.2em/1.1 'Crimson Text', serif;
  font-weight: 400;
  text-align: center;
  margin: 0 0 0.15em;
  letter-spacing: 0.02em;
}

.subtitle {
  text-align: center;
  font-style: italic;
  color: #666;
  margin: 0 0 2em;
  font-size: 0.95em;
}

/* logo */
.logo {
  display: inline-block;
  margin: 0 0 1.2em;
}

.ill {
  display: block;
  margin: 2.5em auto 1.8em;
  width: 85%;
  height: auto;
}

/* TOC */
.toc {
  border-top: 0.5pt solid #1a1a1a;
  border-bottom: 0.5pt solid #1a1a1a;
  padding: 1em 0;
  margin-bottom: 2em;
}

.toc-label {
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.85em;
  margin-bottom: 0.6em;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 2em;
  column-rule: 0.2pt solid #ccc;
}

.toc li {
  break-inside: avoid;
  padding: 0.1em 0;
}

.toc a {
  color: inherit;
  text-decoration: none;
  font-size: 0.95em;
}

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

.toc .num {
  display: inline-block;
  width: 1.8em;
  text-align: right;
  margin-right: 0.5em;
  color: #999;
  font-size: 0.85em;
}

/* phase headings */
.phase {
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 1.25em;
  color: #555;
  text-align: center;
  margin: 3.5em 0 1.5em;
  border-bottom: 0.5pt solid #ccc;
  padding-bottom: 0.5em;
}

/* concept entries */
.entry {
  margin-bottom: 1.8em;
  scroll-margin-top: 1em;
}

.entry-head {
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 0.2em;
}

.entry-num {
  color: #999;
  font-weight: 400;
  font-size: 0.8em;
  margin-right: 0.3em;
}

.entry p {
  margin: 0.5em 0 0;
  text-indent: 0;
}

/* term highlights */
.term {
  font-weight: 600;
}

.it {
  font-style: italic;
}

/* example blocks */
.ex {
  font-family: 'Courier New', 'Courier', monospace;
  font-size: 0.82em;
  line-height: 1.6;
  background: #faf8f5;
  border-left: 2pt solid #ddd;
  padding: 0.8em 1em;
  margin: 0.6em 0;
  white-space: pre;
  overflow-x: auto;
}

/* definition pairs */
.defs {
  margin: 1.2em 0;
  padding: 0;
  display: grid;
  grid-template-columns: 8em 1fr;
  border-top: 0.5pt solid #e5e5e5;
  border-bottom: 0.5pt solid #e5e5e5;
}

.defs dt {
  font-weight: 600;
  padding: 0.3em 0.5em 0.3em 0;
  border-bottom: 0.3pt solid #eee;
}

.defs dd {
  margin: 0;
  padding: 0.3em 0 0.3em 0.5em;
  border-bottom: 0.3pt solid #eee;
}

.defs dt:nth-of-type(even),
.defs dd:nth-of-type(even) {
  background: #faf8f5;
}

.defs dt:last-of-type,
.defs dd:last-of-type {
  border-bottom: none;
}

/* note */
.note {
  font-style: italic;
  color: #666;
  font-size: 0.92em;
  margin: 0.4em 0;
  text-indent: 0 !important;
}

/* footer */
footer {
  border-top: 0.5pt solid #1a1a1a;
  margin-top: 3em;
  padding-top: 0.8em;
  text-align: center;
  font-size: 0.8em;
  color: #999;
}

footer a {
  color: #666;
  text-decoration: none;
}

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

@media (max-width: 600px) {
  body { padding: 1.5em; font-size: 12pt; }
  .toc ol { columns: 1; }
  .defs dt { float: none; width: auto; }
  .defs dd { margin-left: 0; }
}
