@font-face {
 font-family: "Atkinson Hyperlegible Next";
 font-style: normal;
 font-weight: 300 400;
 font-display: swap;
 src: url(p/fonts/atkinson-next.woff2) format("woff2");
}

@font-face {
 font-family: "Roboto Mono";
 font-style: normal;
 font-weight: 400;
 font-display: swap;
 src: url(p/fonts/roboto-mono-400.woff2) format("woff2");
}

:root {
 --accent: #23c030;
 --border: #1d261d;
 --dim: #3d553d;
 --mono: "Roboto Mono", monospace;
 --body: "Atkinson Hyperlegible Next", sans-serif;
}

*,
*::before,
*::after {
 box-sizing: border-box;
 margin: 0;
}

a {
 text-decoration: none;
}

body {
 background-color: #0a0a0a;
 color: #eee;
 font-family: var(--mono);
 font-weight: 300;
 line-height: 1.7;
 max-width: 900px;
 margin: 24px auto;
 min-height: calc(100dvh - 48px);
 display: grid;
 grid-template-rows: auto auto 1fr auto;
 grid-template-columns: 1fr 200px;
 grid-template-areas:
  "header  header"
  "nav     nav"
  "content sidebar"
  "comments .";
 border: 1px solid var(--border);
 border-radius: 8px;
}

@keyframes hackeranim {
 0% {
  content: "/";
 }
 25% {
  content: "|.";
 }
 50% {
  content: "\\..";
 }
 75% {
  content: "-...";
 }
 100% {
  content: "/";
 }
}

.top-header {
 grid-area: header;
 padding: 10px 20px;
 border-bottom: 1px solid var(--border);
 background: linear-gradient(180deg, #0d160d, #0a0a0a);
 color: var(--accent);
 font-weight: 400;
 font-size: 13px;
 display: flex;
 align-items: center;

 &::after {
  animation: hackeranim 1.5s 0s 2;
  content: url("p/media/a.svg");
  height: 20px;
  line-height: 20px;
  overflow: hidden;
 }
}

.site-nav {
 grid-area: nav;
 padding: 8px 20px;
 border-bottom: 1px solid var(--border);
 display: flex;
 gap: 4px;
 font-size: 13px;
 background: #0c0c0c;

 & a {
  color: #888;
  transition: color 0.15s;

  &::before {
   content: "[";
   color: var(--dim);
  }
  &::after {
   content: "]";
   color: var(--dim);
  }

  &:hover,
  &[aria-current="page"] {
   color: #ccc;
  }
 }
}

#main-content {
 grid-area: content;
 padding: 28px 24px;
 min-width: 0;
 font-family: var(--body);

 & h1 {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
 }

 & h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #5aaf64;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
 }

 & .post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: #797979;
  margin-bottom: 16px;
 }

 & p {
  color: #999;
  margin-bottom: 0.8em;
 }

 & .post-listing {
  padding-bottom: 1.2em;
  margin-bottom: 1.2em;
  border-bottom: 1px solid var(--border);
 }

 & a {
  color: var(--accent);
  &:hover {
   text-decoration: underline;
  }
 }

 & code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #1a1a1a;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
 }

 & pre {
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 1em 0;

  & code {
   background: none;
   padding: 0;
   border: none;
  }
 }
}

.recent-posts {
 grid-area: sidebar;
 padding: 28px 20px 28px 16px;
 border-left: 1px dotted var(--border);
 font-size: 13px;

 & .sidebar-heading {
  color: #5aaf64;
  font-size: 11px;
  display: block;
  margin-bottom: 12px;
 }

 & .sidebar-subheading {
  color: #797979;
  font-size: 11px;
  display: block;
  margin: 14px 0 8px;
 }

 & a {
  display: block;
  color: #888;
  margin-bottom: 6px;
  transition: color 0.15s;

  &::before {
   content: "- ";
   color: var(--dim);
  }
  &:hover {
   color: #ccc;
  }
 }


}

.comments {
 grid-area: comments;
 padding: 20px 24px 28px;
 border-top: 1px solid var(--border);
 font-size: 14px;

 & .atk-comment > .atk-avatar {
  display: none;
 }

 & .atk-comment > .atk-main {
  margin-left: 0;
 }

 & .atk-comment-children > .atk-comment-wrap {
  border-left-color: var(--border);

  & > .atk-comment > .atk-main {
   margin-left: 12px;
  }
 }

 & .atk-content {
  font-family: var(--body);
 }

 /* Comment count, empty state and footer: small like post meta; no "Powered by" credit */
 &.artalk > .atk-list > .atk-list-header .atk-comment-count {
  font-size: 12px;

  & .atk-comment-count-num {
   font-size: 12px;
  }
 }

 &.artalk > .atk-list > .atk-list-body {
  min-height: 0;
 }

 & .atk-list-no-comment {
  font-size: 12px;
  height: 75px;
 }

 &.artalk > .atk-list > .atk-list-footer .atk-copyright {
  display: none;
 }

 & code,
 & pre {
  font-family: var(--mono);
 }

 /* Comment form: the typing area matches posted comments, fields and button match the site UI */
 & .atk-main-editor > .atk-header input {
  font-size: 13px;
 }

 & .atk-main-editor > .atk-textarea-wrap > .atk-textarea {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.7;
  min-height: 96px;
 }

 & .atk-main-editor > .atk-bottom .atk-send-btn {
  color: #0a0a0a;
  height: 26px;
  min-width: 5em;
  font-size: 13px;
 }
}

/* Artalk sets its colours on .artalk.atk-dark-mode; these selectors are one class more
   specific. .atk-layer-wrap holds its pop-ups (captcha, admin sidebar). */
.comments.artalk.atk-dark-mode,
body .atk-layer-wrap.atk-dark-mode {
 --at-color-font: #ccc;
 --at-color-deep: #eee;
 --at-color-sub: #999;
 --at-color-grey: #888;
 --at-color-meta: #797979;
 --at-color-border: var(--border);
 --at-color-light: var(--accent);
 --at-color-main: var(--accent);
 --at-color-bg: #0a0a0a;
 --at-color-bg-transl: rgba(10, 10, 10, 0.95);
 --at-color-bg-grey: #0c0c0c;
 --at-color-bg-grey-transl: rgba(12, 12, 12, 0.95);
 --at-color-bg-light: rgba(35, 192, 48, 0.1);
}

@media (max-width: 600px) {
 body {
  margin: 0;
  border: none;
  border-radius: 0;
  min-height: 100dvh;
  grid-template-columns: 1fr;
  grid-template-areas:
   "header"
   "nav"
   "content"
   "sidebar"
   "comments";
 }

 .recent-posts {
  border-left: none;
  border-top: 1px dotted #333;
 }
}
