/*
 * style.css — the lab site.
 *
 * The same warm palette as the teaching platform, deliberately: the two are
 * one lab and should not look like two organisations. Indigo accent, paper
 * ground, a serif for headings and a system stack for reading.
 *
 * No web fonts, no framework, no build step for the CSS. It loads instantly on
 * a phone on campus wifi, which is where most of the people who follow a link
 * to this site will open it.
 */

:root {
  --desk: #f2ece4;
  --sheet: #fffdfa;
  --card: #fffefc;
  --ink: #33302c;
  --muted: #6f665f;
  --line: #e6ddd2;

  --accent: #5b5bd6;
  --accent-soft: #eeeefc;
  --bar: #2b2724;
  --bar-ink: #f5f2ee;
  --bar-dim: #b3aaa2;
  --bar-accent: #e08a4a;

  --radius: 14px;
  --measure: 74ch;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------------- bar */

.bar { background: var(--bar); color: var(--bar-ink); position: sticky; top: 0; z-index: 9; }
.bar-inner {
  max-width: calc(var(--measure) + 200px);
  margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px; height: 58px;
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
  color: var(--bar-ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--bar-accent); }
.bar nav { margin-left: auto; display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.bar nav a, .bar nav .here {
  color: var(--bar-ink); text-decoration: none;
  padding: 7px 13px; border-radius: 8px; font-size: .95rem; white-space: nowrap;
}
.bar nav a:hover { background: rgba(255, 255, 255, .12); }
.bar nav .here { background: var(--bar-accent); color: #fff; font-weight: 600; }

/* --------------------------------------------------------------- reading */

.wrap { max-width: var(--measure); margin: 0 auto; padding: 40px 32px 64px; }

main.wrap {
  background: var(--sheet);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 60vh;
  max-width: calc(var(--measure) + 120px);
  padding: 44px 60px 72px;
}

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; margin: 0 0 .4em; }
h2 { font-size: 1.45rem; margin: 1.9em 0 .5em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.13rem; margin: 1.6em 0 .3em; }
h4 { font-size: 1rem; margin: 1.4em 0 .2em; color: var(--muted); }

p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.hero {
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.55;
  color: var(--muted); margin: 0 0 1.8em;
}

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin: .45em 0; }
li::marker { color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

blockquote {
  margin: 1.4em 0; padding: .2em 0 .2em 1.2em;
  border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em; background: var(--accent-soft); color: #3b3ba8;
  padding: 1px 5px; border-radius: 5px;
}

img { max-width: 100%; height: auto; border-radius: 10px; }

/* A callout: ::: note ... ::: */
.callout {
  margin: 1.5em 0; padding: 16px 20px;
  background: var(--accent-soft); border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}
.callout p:last-child { margin-bottom: 0; }
.callout-todo { background: #fff4ed; border-left-color: #c2620c; }

/* ------------------------------------------------------------------ foot */

footer { background: var(--bar); color: var(--bar-dim); margin-top: 0; }
.foot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px; padding: 34px 32px 44px; font-size: .92rem; line-height: 1.6;
}
.foot strong { color: var(--bar-ink); font-family: var(--serif); font-size: 1.02rem; }
.foot a { color: var(--bar-ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.elsewhere { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* ----------------------------------------------------------------- small */

@media (max-width: 720px) {
  body { font-size: 17px; }
  .bar-inner { padding: 0 16px; height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; }
  .bar nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .bar nav a, .bar nav .here { padding: 6px 10px; font-size: .9rem; }
  main.wrap { padding: 28px 20px 48px; border-left: 0; border-right: 0; }
  .wrap { padding: 24px 20px 40px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.25rem; }
}

@media print {
  .bar, footer { display: none; }
  body { background: #fff; font-size: 11pt; }
  main.wrap { border: 0; padding: 0; max-width: none; }
  a { color: #000; }
}
