/* Shared stylesheet for all MCP lessons. Tufte-inspired: calm, readable, print-friendly. */

:root {
  --ink: #1a1a1a;
  --paper: #fffff8;
  --muted: #6b6b63;
  --rule: #d8d8cf;
  --accent: #8a2b06;      /* host */
  --accent2: #1c5a78;     /* client */
  --accent3: #2e6b3e;     /* server */
  --code-bg: #f4f3ea;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: et-book, Palatino, "Palatino Linotype", Georgia, serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.kicker {
  font-family: "SF Mono", "Fira Code", ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 0.4rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin: 2.6rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

h3 { font-size: 1.05rem; font-weight: 600; margin: 1.6rem 0 0.4rem; }

p { margin: 0.7rem 0; }

a { color: var(--accent2); text-underline-offset: 2px; }

.lead { font-size: 1.12rem; color: #333; }

.win {
  border-left: 3px solid var(--accent3);
  background: #f3f7f3;
  padding: 0.8rem 1.1rem;
  margin: 1.4rem 0;
  font-size: 0.98rem;
}
.win strong { color: var(--accent3); }

blockquote {
  border-left: 3px solid var(--rule);
  margin: 1.2rem 0;
  padding: 0.2rem 1.1rem;
  color: #444;
  font-style: italic;
}

code {
  font-family: "SF Mono", "Fira Code", ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.45;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* citation superscripts */
sup.cite { font-size: 0.7em; }
sup.cite a { text-decoration: none; }

/* role colour coding, reused across lessons */
.role-host   { color: var(--accent);  font-weight: 600; }
.role-client { color: var(--accent2); font-weight: 600; }
.role-server { color: var(--accent3); font-weight: 600; }

/* simple diagram */
.diagram {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 1.6rem 0;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  text-align: center;
}
.node {
  border: 1.5px solid;
  border-radius: 8px;
  padding: 0.7rem 0.6rem;
  flex: 1;
  background: #fff;
}
.node small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 0.3rem; }
.node.host   { border-color: var(--accent);  }
.node.client { border-color: var(--accent2); }
.node.server { border-color: var(--accent3); }
.arrow { display: flex; align-items: center; padding: 0 0.5rem; color: var(--muted); }

/* quiz widget */
.quiz {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  margin: 1.3rem 0;
  background: #fcfcf5;
}
.quiz .q { font-weight: 600; margin-bottom: 0.7rem; }
.quiz button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.55rem 0.8rem;
  margin: 0.4rem 0;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.quiz button:hover { background: #f4f3ea; }
.quiz button.correct { background: #e6f3e8; border-color: var(--accent3); }
.quiz button.wrong   { background: #f7e7e3; border-color: var(--accent); }
.quiz .feedback {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
  color: #444;
}

/* top breadcrumb bar, present on every lesson */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -2rem 0 2.4rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.topbar a { color: var(--accent); text-decoration: none; font-weight: 600; }
.topbar a:hover { text-decoration: underline; }
.topbar .mid { color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; }
.topbar .prog {
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}

.footer-nav {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.footer-nav a { color: var(--accent2); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-nav .nav-mid a { color: var(--muted); }
.footer-nav .nav-end { text-align: right; }
.footer-nav .nav-disabled { color: var(--rule); }

.ask {
  margin-top: 2.5rem;
  background: #fbf6ee;
  border: 1px dashed #d8c4a0;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
}
.ask strong { color: var(--accent); }

.source {
  margin-top: 2rem;
  font-size: 0.92rem;
}
.source a { font-weight: 600; }
