:root {
  --ink: #313431;
  --muted: #6f746f;
  --paper: #fff;
  --line: #ccc;
  --link: #5ab300;
  --link-hover: #315f08;
  --layout: 800px;
  --sidebar: 150px;
  --content: 640px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  /* Crop the image's top 80px and still cover tall windows without a gap below. */
  background: #333 url('../images/background.jpg') 0 -80px / max(100vw, 1920px, calc(177.778vh + 142.222px)) auto fixed no-repeat;
  font: 12px/15px Georgia, 'DejaVu Serif', Times, serif;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--link-hover); }
img { display: block; max-width: 100%; height: auto; }

.site-header,
.site-grid,
.site-footer {
  width: min(calc(100% - 24px), var(--layout));
  margin-inline: auto;
}

.site-header { height: 60px; padding: 20px 0 10px; }
.site-header h1 { margin: 0; font: 700 14px/15px 'Trebuchet MS', Arial, sans-serif; }
.site-title {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.site-title:hover { color: #fff; }

.site-grid {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, var(--content));
  align-items: start;
  gap: 10px;
}

.sidebar {
  position: static;
  padding: 0 4px 4px;
  color: #fff;
}
.userpic { display: block; width: 150px; height: 100px; margin-bottom: 20px; opacity: .6; }
.userpic img { width: 100px; height: 100px; object-fit: cover; }
.sidebar nav { display: grid; justify-items: start; gap: 0; }
.sidebar nav a { padding: 2px 2px 2px 0; color: #333; font: 400 9.6px/15px Verdana, Helvetica, sans-serif; text-decoration: none; }
.sidebar nav a:hover { color: #5ab300; text-decoration: underline; }
.sidebar nav a[aria-current] { color: #fff; font-weight: 700; }

.main { width: min(100%, var(--content)); min-width: 0; }
.entries, .page-card, .page-heading { background: var(--paper); }
.entries {
  width: calc(100% - 20px);
  max-width: 620px;
  margin: 0 10px;
  padding: 0 15px 15px;
  border: 1px solid var(--line);
  opacity: .92;
}

.entry { padding: 5px 5px 15px; background: #fff; overflow-wrap: anywhere; }
.entry:not(:last-child) { border-bottom: 1px solid var(--line); }
.entry-header h2 { margin: 20px 0 6px; font: 700 18px/18px 'Trebuchet MS', Arial, sans-serif; }
.entry-header h2 a { color: var(--ink); text-decoration: none; }
.entry-header time { color: #666; font: 700 9.6px/15px Verdana, Helvetica, sans-serif; }
.entry-body { margin: 15px 0; }
.entry-body p { margin: 0; }
.entry-body p + p { margin-top: 15px; }
.entry-body blockquote { margin: 1.2em 0; padding-left: 1.2em; border-left: 3px solid var(--line); }
.entry-body pre { overflow: auto; padding: 12px; background: #f3f4f1; }
.entry-body img { margin: 1em auto; }
.entry-tags { margin: 12px 0; color: #666; font: 700 9.6px/15px Verdana, Helvetica, sans-serif; }
.entry-footer { display: flex; flex-wrap: wrap; gap: .35em; margin-bottom: 13px; color: #666; font: 700 9.6px/15px Verdana, Helvetica, sans-serif; }
.entry-footer a { font-weight: 700; }

.page-card {
  width: calc(100% - 20px);
  max-width: 620px;
  margin: 0 10px;
  padding: 20px;
  border: 1px solid var(--line);
  opacity: .92;
}
.page-card > :first-child, .page-heading > :first-child { margin-top: 0; }
.page-heading { padding: 20px 5px 0; }
.page-heading h1, .page-card h1 { font: 700 18px/18px 'Trebuchet MS', Arial, sans-serif; }
.prose { min-height: 230px; }

.archive h2 { margin: 1.6em 0 .2em; font: 700 18px/18px 'Trebuchet MS', Arial, sans-serif; }
.archive h3 { margin: 1em 0 .3em; color: var(--muted); font-size: 15px; text-transform: lowercase; }
.archive ul { margin: 0; padding: 0; list-style: none; }
.archive li { display: grid; grid-template-columns: 2.2em 1fr; gap: .4em; padding: .15em 0; }
.archive time { color: var(--muted); font-variant-numeric: tabular-nums; }

.friends ul { display: flex; flex-wrap: wrap; gap: .3em .7em; padding: 0; list-style: none; }
.friends li { white-space: nowrap; }

.profile-header {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.profile-header img { width: 100px; height: 100px; object-fit: cover; }
.profile-header h1 { margin: 6px 0 3px; }
.profile-header p { margin: 0; color: var(--muted); }
.profile-username { font: 700 12px/15px Verdana, Helvetica, sans-serif; }
.profile-facts { margin: 0; }
.profile-facts div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid #e4e4e4; }
.profile-facts dt { color: var(--muted); font: 700 9.6px/15px Verdana, Helvetica, sans-serif; }
.profile-facts dd { margin: 0; }
.profile-section { margin-top: 22px; }
.profile-section h2 { margin: 0 0 8px; font: 700 15px/18px 'Trebuchet MS', Arial, sans-serif; }
.profile-section h2 span { color: var(--muted); font-size: 12px; }
.profile-section p { margin: 0; }
.profile-links { display: flex; flex-wrap: wrap; gap: .3em .7em; margin: 0; padding: 0; list-style: none; }
.profile-links li { overflow-wrap: anywhere; }

.comments { margin: 10px; padding: 0 0 18px; }
.comments > h2 { margin: 20px 0 10px -10px; font: 700 18px/18px 'Trebuchet MS', Arial, sans-serif; }
.comment {
  display: block;
  min-height: 90px;
  margin: 10px 0 10px min(calc(var(--depth) * 30px), 45%);
  padding: 5px;
  background: #fff;
}
.comment::after { display: block; clear: both; content: ''; }
.comment-avatar { float: right; width: auto; max-width: 103px; height: 95px; padding: 5px; object-fit: contain; }
.comment-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25em .7em; }
.comment-header strong { font: 700 15.6px/16px 'Trebuchet MS', Arial, sans-serif; }
.comment-header time { color: #666; font: 700 9.6px/15px Verdana, Helvetica, sans-serif; }
.comment-body { margin: 15px 0; }

.site-footer { padding: 18px 0 38px calc(var(--sidebar) + 10px); color: #fff; font-size: 10px; }
.site-footer a { color: #fff; }

@media (max-width: 720px) {
  body { background-position: center -80px; background-size: auto calc(100vh + 80px); background-attachment: fixed; font-size: 16px; line-height: 1.5; }
  .site-header, .site-grid, .site-footer { width: calc(100% - 20px); }
  .site-header { height: auto; padding: 20px 0 12px; }
  .site-grid { grid-template-columns: 1fr; gap: 12px; }
  .main { width: 100%; }
  .sidebar {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    align-items: center;
    padding: 0;
  }
  .userpic { width: 72px; height: 72px; margin: 0; }
  .userpic img { width: 72px; height: 72px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 5px 13px; }
  .sidebar nav a { color: #fff; font-size: 12px; }
  .entries { width: 100%; margin: 0; padding: 0 10px 10px; }
  .entry { padding: 5px 5px 15px; }
  .entry-header h2 { font-size: 19px; line-height: 20px; }
  .entry-header time, .entry-footer, .entry-tags { font-size: 10px; }
  .page-card { width: 100%; margin: 0; padding: 18px; }
  .profile-facts div { grid-template-columns: 130px 1fr; }
  .comments { margin-inline: 0; }
  .comments > h2 { margin-left: 0; }
  .comment { min-height: 0; margin-left: min(calc(var(--depth) * 8px), 12%); padding: 8px; }
  .comment-avatar { width: auto; max-width: 58px; height: 58px; padding: 4px; }
  .comment-header strong { font-size: 16px; line-height: 18px; }
  .comment-header time { font-size: 10px; }
  .site-footer { padding: 14px 0 28px; }
}

@media (max-width: 390px) {
  .site-header, .site-grid, .site-footer { width: calc(100% - 12px); }
  .entry-header h2 { font-size: 18px; }
  .comment-avatar { display: none; }
  .profile-header { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .profile-header img { width: 72px; height: 72px; }
  .profile-facts div { grid-template-columns: 1fr; gap: 1px; }
}

@media print {
  body { color: #000; background: #fff; }
  .site-header, .sidebar, .site-footer { display: none; }
  .site-grid { display: block; width: 100%; }
  .entries, .page-card { border: 0; opacity: 1; }
}
