/* The whole site's stylesheet. Started as the terminimal theme
   (orange accent, dark background, Hack subset), compiled out of its Sass. */

/*!
 *  Hack typeface https://github.com/source-foundry/Hack
 *  License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md
 */
@font-face {
  font-family: 'Hack';
  /* Use full version (not a subset) for unicode icon support */
  src: url('fonts/hack-regular.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-regular.woff?sha=3114f1256') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Hack';
  src: url('fonts/hack-bold-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bold-subset.woff?sha=3114f1256') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Hack';
  src: url('fonts/hack-italic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-italic-subset.woff?sha=3114f1256') format('woff');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Hack';
  src: url('fonts/hack-bolditalic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bolditalic-subset.woff?sha=3114f1256') format('woff');
  font-weight: 700;
  font-style: italic;
}

:root {
  --accent: rgb(255,168,106);
  --accent-alpha-70: rgba(255,168,106,.7);
  --background: #101010;
  --color: #A9B7C6;
  --border-color: rgba(255, 255, 255, .1);
}

/* Page */

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
  font-size: 1rem;
  line-height: 1.54;
  background-color: var(--background);
  color: var(--color);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

/* Film grain over the whole page. */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 40px;
  max-width: 864px;
  min-height: 100vh;
  margin: 0 auto;
}

@media (max-width: 683px) {
  .container {
    padding: 20px;
  }
}

.content {
  display: block;
}

.transition-fade {
  opacity: 1;
  transition: opacity 0.15s ease;
}

html.is-animating .transition-fade {
  opacity: 0;
}

/* Content elements */

h1, h2, h3, h4, h5, h6 {
  display: flex;
  align-items: center;
  font-weight: bold;
  line-height: 1.3;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.2rem;
}

h4, h5, h6 {
  font-size: 1.15rem;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

p {
  margin-bottom: 20px;
}

code {
  font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
  font-feature-settings: normal;
  background: #2a2a2a;
  color: #c0c0c0;
  padding: 1px 6px;
  margin: 0 2px;
  font-size: .95rem;
}

/* !important beats the inline background the highlighter puts on <pre>. */
pre {
  font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
  background-color: #2a2a2a !important;
  padding: 20px;
  font-size: .95rem;
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

@media (max-width: 683px) {
  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

pre code {
  padding: 0;
  margin: 0;
  background: none;
}

blockquote {
  position: relative;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  margin: 40px 0;
  padding: 25px;
}

@media (max-width: 683px) {
  blockquote {
    padding-right: 0;
  }
}

blockquote:before {
  content: '”';
  font-family: Georgia, serif;
  font-size: 3.875rem;
  position: absolute;
  left: -40px;
  top: -20px;
}

blockquote p:first-of-type {
  margin-top: 0;
}

blockquote p:last-of-type {
  margin-bottom: 0;
}

blockquote p {
  position: relative;
}

blockquote p:before {
  content: '>';
  display: block;
  position: absolute;
  left: -25px;
  color: var(--accent);
}

table {
  table-layout: fixed;
  border-collapse: collapse;
  width: 100%;
  margin: 40px 0;
}

table, th, td {
  border: 1px dashed var(--accent);
  padding: 10px;
}

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

ul, ol {
  margin-left: 30px;
  padding: 0;
}

ul li, ol li {
  position: relative;
}

@media (max-width: 683px) {
  ul, ol {
    margin-left: 20px;
  }
}

ol ol {
  list-style-type: lower-alpha;
}

hr {
  width: 100%;
  border: none;
  background: var(--border-color);
  height: 1px;
}

/* Header and menu */

.header {
  display: flex;
  flex-direction: column;
  position: relative;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  flex: 1;
}

.header__logo a {
  flex: 0 0 auto;
  max-width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: var(--accent);
  color: black;
  padding: 5px 10px;
}

.header .menu {
  margin: 20px 0;
}

.header .menu__inner {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .menu__inner li.active a {
  color: var(--accent);
}

.header .menu__inner li:not(:last-of-type) {
  margin-right: 20px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

@media (min-width: 900px) {
  .header {
    flex-direction: row;
    align-items: center;
  }

  .header .menu {
    margin: 0 0 0 30px;
  }
}

/* Posts */

.posts {
  width: 100%;
  margin: 0 auto;
}

.post {
  width: 100%;
  text-align: left;
  margin: 20px auto;
  padding: 20px 0;
}

@media (max-width: 899px) {
  .post {
    max-width: 660px;
  }
}

.post:not(:last-of-type) {
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  position: relative;
  color: var(--accent);
  margin: 0 0 15px;
  padding-bottom: 15px;
  border-bottom: 2px dashed var(--accent);
  font-weight: normal;
}

.post-title a {
  text-decoration: none;
}

.posts .post.on-list .post-title {
  font-size: 1.2em;
}

.post .post-meta-inline {
  display: inline;
  font-size: 1rem;
  margin-bottom: 10px;
  color: #aaa;
}

.post .post-tags-inline {
  display: inline;
  margin-bottom: 20px;
  font-size: 1rem;
  color: #aaa;
}

@media (max-width: 683px) {
  .post .post-tags-inline {
    display: block;
  }
}

.post-content {
  margin-top: 30px;
}

.post-content h2 {
  margin-top: 2.5em;
}

.post ul {
  list-style: none;
}

.post ul li:before {
  content: '►';
  position: absolute;
  left: -20px;
  color: var(--accent);
}

/* Tag pages: one line per post */

.post-list .post-date {
  color: var(--accent-alpha-70);
  text-decoration: none;
}

.post-list a {
  text-decoration: none;
}

.post-list .post-list-title,
.post-list .post-tag {
  text-decoration: underline;
}

/* ~/path$ headings on home, sections, tags and standalone pages */

.prompt {
  border-bottom: none;
}

.post:has(.prompt) {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.prompt-path {
  color: var(--accent);
}

.prompt-sep,
.prompt-char {
  color: #666;
}

/* Home */

.home-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-photo {
  width: 100%;
  border-radius: 5px;
}

/* Desktop: photo and intro side by side, intro vertically centered against
   the photo. Phones keep the stacked layout. */
@media (min-width: 684px) {
  .home-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: center;
  }

  .home-layout .post-content {
    margin-top: 0;
  }

  .home-layout .post-content > :first-child {
    margin-top: 0;
  }

  .home-layout .post-content > :last-child {
    margin-bottom: 0;
  }
}

.home-recent {
  margin-top: 48px;
}

.home-recent h2 {
  font-size: 1.2em;
  margin: 0 0 12px;
}

.post ul.home-posts {
  margin: 0;
}

.post ul.home-posts li {
  display: flex;
  gap: 24px;
  margin: 6px 0;
}

.post ul.home-posts li:before {
  content: none;
}

.home-post-date {
  flex-shrink: 0;
  color: #aaa;
}

@media (max-width: 683px) {
  .post ul.home-posts li {
    flex-direction: column;
    gap: 0;
    margin: 12px 0;
  }
}

/* Buttons: "Read more", pagination, earlier / later post */

button,
.button,
a.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  margin-bottom: 5px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid transparent;
  appearance: none;
  cursor: pointer;
  outline: none;
}

a.read-more,
a.read-more:hover,
a.read-more:active {
  display: inline-flex;
  background: none;
  box-shadow: none;
  padding: 0;
  margin: 20px 0;
  max-width: 100%;
}

.pagination {
  margin-top: 50px;
}

.pagination__title {
  display: flex;
  text-align: center;
  position: relative;
  margin: 100px 0 20px;
}

.pagination__title-h {
  text-align: center;
  margin: 0 auto;
  padding: 5px 10px;
  background: var(--background);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  z-index: 1;
}

.pagination__title hr {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  margin-top: 15px;
  z-index: 0;
}

.pagination__buttons {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 683px) {
  .pagination__buttons {
    flex-direction: column;
  }
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: 8px;
  max-width: 40%;
  padding: 0;
  cursor: pointer;
  appearance: none;
}

@media (max-width: 683px) {
  .button {
    max-width: 80%;
  }
}

.button + .button {
  margin-left: 10px;
}

.button a {
  display: flex;
  padding: 8px 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.button__text {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Footer: an empty line under the content */

.footer {
  padding: 40px 0;
  flex-grow: 0;
  opacity: .5;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  width: 760px;
  max-width: 100%;
}

@media (max-width: 899px) {
  .footer__inner {
    flex-direction: column;
  }
}

.footer .copyright {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 1rem;
  margin: auto;
  text-align: center;
}

@media (max-width: 899px) {
  .footer .copyright {
    flex-direction: column;
    margin-top: 10px;
  }
}
