/* ----------------------------------------------------------
   davidlitman.com
   Single stylesheet. No frameworks, no build step.
   Edit the variables below to retune the whole site.
---------------------------------------------------------- */

:root {
  --text:        #1a1a1a;
  --dim:         #6b6b6b;
  --paper:       #fbfaf7;     /* warm off-white, like printed paper */
  --rule:        #d8d4cb;
  --accent:      #7a1f1f;     /* deep oxblood for links */
  --accent-hover:#b3322f;

  --serif:       "EB Garamond", "Iowan Old Style", "Apple Garamond", Garamond, Georgia, serif;
  --sans:        "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono:        "iA Writer Mono S", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure:     34rem;       /* readable column width */
  --lh:          1.55;
}

@font-face {
  font-family: "EB Garamond";
  src: url("https://fonts.gstatic.com/s/ebgaramond/v27/SlGUmQSNjdsmc35JDF1K5FRyTRq8Vw.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("https://fonts.gstatic.com/s/ebgaramond/v27/SlGUmQSNjdsmc35JDF1K5FRyXBq8Vw.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* --- Masthead ----------------------------------------- */

.masthead {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead h1 {
  font-size: 2.4rem;
  font-weight: 400;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.affil {
  margin: 0 0 0.5rem;
  color: var(--dim);
  font-style: italic;
}

.contact {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--dim);
  margin: 0;
}

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

/* --- Sections ----------------------------------------- */

section {
  margin: 2.5rem 0;
}

h2 {
  font-size: 1.05rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

.bio {
  font-size: 1.02rem;
}

/* --- Figures (photos, etc.) ----------------------------- */

.figure {
  margin: 2rem 0 2.25rem;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.figure figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--dim);
  margin-top: 0.5rem;
  font-style: italic;
}

.figure--small {
  margin: 1.25rem 0 0;
  max-width: 15rem;
}

.figure--medium {
  margin: 1.5rem 0 2rem;
  max-width: 18rem;
}

.tips {
  margin-top: 3rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--dim);
}

.tips h2 {
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
  color: var(--dim);
}

.tips .list li {
  margin-bottom: 0.45rem;
}

.tips strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Links -------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 31, 31, 0.25);
  transition: color 0.15s, border-color 0.15s;
}

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

/* --- Lists -------------------------------------------- */

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  margin-bottom: 0.9rem;
  padding-left: 1rem;
  text-indent: -1rem;
}

.list li::before {
  content: "—  ";
  color: var(--dim);
}

/* Bibliography (books, etc.) */

.biblio {
  list-style: none;
  padding: 0;
  margin: 0;
}

.biblio li {
  margin-bottom: 0.65rem;
}

.biblio cite {
  font-style: italic;
}

.biblio .dim::before {
  content: " · ";
}

.dim {
  color: var(--dim);
}

/* --- Home: large section links ------------------------ */

.big-links {
  display: flex;
  flex-direction: column;
  margin: 2.5rem 0 3rem;
  border-top: 1px solid var(--rule);
}

.big-link {
  display: block;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

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

/* --- Footer ------------------------------------------- */

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--dim);
}

footer p { margin: 0; }

/* --- Sub-page styles (used in /math, /neuro, /blog) ---- */

.subpage h1 {
  font-size: 1.8rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.subpage .back {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--dim);
  display: inline-block;
  margin-bottom: 2rem;
}

article.entry {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--rule);
}

article.entry:last-child {
  border-bottom: none;
}

article.entry h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

article.entry .meta {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 0.75rem;
}

/* --- Blog posts --------------------------------------- */

.post h1 {
  margin-bottom: 1.5rem;
}

.post-body {
  margin-bottom: 2rem;
}

.post-body p {
  margin-bottom: 1rem;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body li p {
  margin-bottom: 0.35rem;
}

/* --- Responsive --------------------------------------- */

@media (max-width: 600px) {
  html, body { font-size: 17px; }
  main { padding: 3rem 1.25rem 4rem; }
  .masthead h1 { font-size: 1.9rem; }
  .big-link { font-size: 1.3rem; }
}

/* --- Print -------------------------------------------- */

@media print {
  body { background: white; color: black; }
  a { color: black; border-bottom: none; }
  .contact, footer { display: none; }
}
