:root {
    --bg:#16130f;
    --fg:#cbc4ba;
    --heading:#f2ede6;
    --muted:#9a9088;
    --border:#2e2924;
    --link:#e88a4a;
    --link-hover:#f2a76a;
    --accent:#e0752e;
    --term-bg:#201b16;
    --term-fg:#f0a35e;
  }

  html { scroll-behavior: smooth; }
  :target { scroll-margin-top: 1rem; }
  ::selection { background: var(--accent); color: var(--bg); }

  body {
    background-color: var(--bg);
    padding:50px;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color:var(--fg);
    font-weight:400;
    overflow-wrap:break-word;
  }

  h1, h2, h3, h4, h5, h6 {
    color:var(--heading);
    margin:0 0 20px;
  }

  p, ul, ol, table, pre, dl {
    margin:0 0 20px;
  }

  h1, h2, h3 {
    line-height:1.1;
  }

  h1 {
    font-size:28px;
    font-weight: 500;
  }

  h2, h3, h4, h5, h6 {
    font-weight: 500;
  }

  a {
    color:var(--link);
    text-decoration:none;
    text-underline-offset:2px;
    transition:color .15s;
  }

  a:hover {
    color:var(--link-hover);
    text-decoration:underline;
    text-decoration-thickness:1px;
  }

  a small {
    font-size:11px;
    color:var(--muted);
    margin-top:-0.3em;
    display:block;
  }

  a:hover small {
    color:var(--muted);
  }

  .wrapper {
    display:grid;
    grid-template-columns: minmax(150px, 270px) 1fr;
    grid-template-areas:
      "header section"
      "footer footer";
    column-gap:40px;
    max-width:860px;
    margin:0 auto;
  }

  blockquote {
    border-left:1px solid var(--border);
    margin:0;
    padding:0 0 0 20px;
    font-style:italic;
  }

  code, pre {
    font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
    color:var(--fg);
  }

  pre {
    margin:0 0 20px;
    padding:14px 16px;
    background:var(--term-bg);
    color:var(--term-fg);
    border-radius:8px;
    border:1px solid var(--border);
    box-shadow:0 1px 3px rgba(0,0,0,.35);
    overflow-x:auto;
    font-size:13px;
    line-height:1.5;
  }

  pre code {
    color:inherit;
    background:none;
  }

  table {
    width:100%;
    border-collapse:collapse;
  }

  th, td {
    text-align:left;
    padding:5px 10px;
    border-bottom:1px solid var(--border);
  }

  dt {
    color:var(--heading);
    font-weight:500;
  }

  th {
    color:var(--heading);
  }

  img {
    max-width:100%;
  }

  header {
    grid-area:header;
    -webkit-font-smoothing:subpixel-antialiased;
  }

  header .handle {
    margin:-14px 0 18px;
    color:var(--muted);
    font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size:14px;
  }

  header img {
    width:100%;
    max-width:180px;
    aspect-ratio:1 / 1;
    height:auto;
    border-radius:50%;
    object-fit:cover;
    display:block;
    margin:0 0 20px;
  }

  header h1 a { color:var(--heading); text-decoration:none; }
  header h1 a:hover { color:var(--link); text-decoration:none; }

  header ul a:active {
    background-color:rgba(255,255,255,.05);
  }

  strong {
    color:var(--heading);
    font-weight:500;
  }

  header ul a strong {
    font-size:14px;
    display:block;
    color:var(--heading);
  }

  section {
    grid-area:section;
    min-width:0;
    padding-bottom:50px;
  }

  small {
    font-size:11px;
  }

  hr {
    border:0;
    background:var(--border);
    height:1px;
    margin:0 0 20px;
  }

  footer {
    grid-area:footer;
    -webkit-font-smoothing:subpixel-antialiased;
  }

  @media (max-width: 520px) {
    body { padding:22px; }
    .wrapper {
      grid-template-columns:1fr;
      grid-template-areas:
        "header"
        "section"
        "footer";
      row-gap:10px;
    }
    header img { max-width:150px; }
  }

  @media print {
    :root {
      --bg:#fff; --fg:#222; --heading:#000; --muted:#555;
      --border:#ccc; --link:#000; --term-bg:#f4f4f4; --term-fg:#222;
    }
    body { padding:0.4in; font-size:12pt; }
  }

  #bibtex_display h3 { color:var(--link); }
