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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

img, picture, video, canvas, svg {
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Variables */
:root {
  color-scheme: light dark;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Source Code Pro", Menlo, monospace;
  --font-serif: Georgia, serif;

  --bg: light-dark(#fff, #1a1a2e);
  --bg-raised: light-dark(#f8f9fa, #21262d);
  --bg-surface: light-dark(#fcfcfc, #21262d);
  --bg-nav: light-dark(rgba(255, 255, 255, 0.85), rgba(26, 26, 46, 0.85));
  --fg: light-dark(#666, #c9d1d9);
  --fg-emphasis: light-dark(#222, #e6edf3);
  --fg-default: light-dark(#333, #c9d1d9);
  --fg-muted: light-dark(#aaa, #8b949e);
  --fg-faint: light-dark(#999, #6e7681);
  --fg-dim: light-dark(#cdd4da, #484f58);
  --accent: light-dark(#5694f1, #79c0ff);
  --border: light-dark(#eee, #30363d);
}

.hidden {
  display: none;
}

/* Spacing */
.post h1,
h3,
h4,
h5,
p,
.post-body ul,
ol,
pre {
  margin-bottom: 20px;
}

/* Base */
html,
body {
  height: 100%;
}

body {
  font: 18px/1.6 var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:is(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}

h1 {
  font-size: 30px;
  letter-spacing: -1px;
  color: var(--fg-emphasis);
  font-weight: bold;
}

h2 {
  font: italic 19px/1.3em var(--font-serif);
  color: var(--fg-muted);
}

.profile #wrapper {
  padding: 60px 40px 0px;
  max-width: 800px;
  margin: 0 auto;
}

.profile #header {
  padding-bottom: 40px;
  text-align: center;
  position: relative;
}

.profile #avatar {
  display: inline-block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 20px;
}

.profile h1 {
  font-weight: 400;
  letter-spacing: 0px;
  font-size: 20px;
  color: var(--fg-emphasis);
}

.profile h2 {
  font-size: 20px;
  font-weight: 400;
  color: var(--fg-muted);
  margin-top: 10px;
  font-family: var(--font-sans);
  font-style: normal;
}

nav.main-nav {
  position: sticky;
  top: 0;
  padding: 12px 20px;
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-nav);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  gap: 4px;
  align-items: center;
}

nav.main-nav a {
  padding: 6px 10px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 3px;
  transition: color 0.15s ease;
}

nav.main-nav a:first-child {
  color: var(--fg-emphasis);
  font-weight: 600;
  margin-right: auto;
}

nav.main-nav a:hover {
  color: var(--accent);
}

#wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px 100px 40px;
}

#wrapper.home {
  max-width: 800px;
  margin: 0 auto;
  padding: 0px 40px 20px 40px;
}

.home #avatar {
  float: right;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Typography */
a,
#title,
#post-list a:hover,
#post-list li:hover .dates,
#title:hover {
  text-decoration: none;
  color: var(--accent);
}

p a {
  color: var(--accent);
}
ul,
ol {
  margin: 0;
  padding: 0;
  margin-bottom: 20px;
}
ul {
  list-style-type: circle;
}
ol {
  list-style: decimal;
}
li {
  list-style-position: inside;
}

/* Line Height */
#post-body,
p {
  line-height: 1.7;
}

b,
strong {
  font-weight: 500;
  color: var(--fg-emphasis);
}
em,
i {
  font-style: italic;
}

#title {
  display: inline-block;
  line-height: 100%;
  font-weight: 500;
  font-size: 19px;
  margin: 0;
  padding-bottom: 20px;
}

.description {
  float: right;
  font: italic 14px/1.4em var(--font-serif);
  color: var(--fg-muted);
}

.home h1 {
  font-size: 30px;
  letter-spacing: -1px;
  color: var(--fg-emphasis);
  font-weight: bold;
}

.home h2 {
  font: italic 19px/1.3em var(--font-serif);
  color: var(--fg-muted);
}

.post header {
  text-align: center;
}

.post h1 {
  margin-bottom: 0px;
  color: var(--fg-emphasis);
  font: 600 32px/1.4em var(--font-sans);
}

.post h2 {
  margin-bottom: 40px;
  font: 500 24px/1.5 var(--font-sans);
  color: var(--fg-emphasis);
}

.post h2.subtitle {
  font: italic 19px/1.3em var(--font-serif);
  color: var(--fg-muted);
}

#post-list h2 {
  font: normal 17px/1.5em var(--font-sans);
  color: var(--fg-muted);
  max-width: 400px;
  margin-top: 2px;
}

h3,
h4,
h5 {
  color: var(--fg-emphasis);
}

h3 {
  font-size: 20px;
  font-weight: 400;
}
h4 {
  font-size: 16px;
  font-weight: bold;
}
h5 {
  font-size: 15px;
  font-weight: bold;
}

h6 {
  font-size: 13px;
  font-weight: bold;
  color: var(--fg);
  margin-bottom: 6px;
}

p.small {
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.5;
  display: block;
  text-align: center;
  margin-top: 20px;
}

blockquote {
  padding: 12px 20px;
  margin: 20px 0;
  border-left: 3px solid var(--accent);
  background: var(--bg-raised);
  border-radius: 0 4px 4px 0;
  color: var(--fg);
}

hr {
  display: block;
  border: none;
  height: 1px;
  margin: 40px auto;
  background: var(--border);
}

span.code {
  font-family: Menlo, Monaco, Courier;
  background-color: var(--border);
  font-size: 14px;
}

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  white-space: pre-wrap;
  padding: 20px;
  overflow: auto;
  border-radius: 8px;
  background: #1e1e2e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6em;
  font-weight: 500;
  color: #cdd6f4;
}

table {
  width: 100%;
  margin: 40px 0;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5em;
}

th,
td {
  text-align: left;
  padding-right: 20px;
  vertical-align: top;
}

table td,
td {
  border-spacing: none;
  border-style: solid;
  padding: 10px 15px;
  border-width: 1px 0 0 0;
  border-color: var(--border);
}

tr > td {
  border-top: 1px solid var(--border);
}

tr:nth-child(odd) > td {
  background: var(--bg-surface);
}

thead th,
th {
  text-align: left;
  padding: 10px 15px;
  height: 20px;
  font-size: 13px;
  font-weight: bold;
  color: var(--fg-default);
  border-bottom: 1px solid var(--border);
  cursor: default;
  white-space: nowrap;
}

img {
  max-width: 100%;
  border-radius: 3px;
}

/*=========================================
Post List
=========================================== */
#archive-list {
  margin-top: 100px;
}

#post-list {
  margin-bottom: 0;
}

#post-list li,
#archive-list li {
  padding-top: 20px;
  padding-bottom: 20px;
  list-style-type: none;
  margin-bottom: 0;
}

#post-list li + li,
#archive-list li + li {
  border-top: 1px solid var(--border);
}

#post-list a {
  color: var(--fg-default);
  display: block;
  font: bold 19px/1.7 var(--font-sans);
}

#post-list .dates {
  float: right;
  position: relative;
  top: 1px;
  font: 400 17px/1.8 var(--font-sans);
  color: var(--fg-muted);
}

#post-list-footer {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 100px;
}

#archive-link {
  display: inline-block;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  padding: 3px 10px 6px;
  box-shadow: 0 0 0 1px var(--accent);
}

#archive-link:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

#archive-link span {
  position: relative;
  top: 0;
  font-size: 17px;
}

#footer {
  padding: 40px 0 0 0;
}

/* Post Page */
.post {
  margin: 80px 0 0 0;
}

#post-meta {
  font-size: 13px;
  font-weight: bold;
  line-height: 1.4;
  border-top: 1px solid var(--border);
  padding-top: 40px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  margin-top: 40px;
  color: var(--fg-default);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#post-meta .post-author {
  display: flex;
  align-items: center;
  gap: 16px;
}

#post-meta div span {
  color: var(--fg-muted);
  font-weight: 500;
  display: block;
}

#post-meta div span.dark {
  color: var(--fg-emphasis);
}

#post-meta img.avatar {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4px var(--border);
}

#sharing {
  display: flex;
  align-items: center;
}

/* Copy link button */
.copy-link {
  font-size: 13px;
  font-weight: bold;
  color: var(--bg);
  background: var(--accent);
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.copy-link:hover {
  opacity: 0.8;
}

/* Post Navigation */
#post-nav {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  margin-top: 20px;
}

#post-nav span {
  position: relative;
}

#post-nav span.prev {
  float: left;
}

#post-nav span.next {
  float: right;
}

#post-nav span .arrow {
  position: relative;
  padding: 1px;
}

#post-nav span.prev:hover .arrow {
  left: -4px;
}

#post-nav span.next:hover .arrow {
  right: -4px;
}

#post-nav span.prev:hover {
  left: -3px;
}

#post-nav span.next:hover {
  right: -3px;
}

/* Archive */
h1.archive {
  margin-bottom: 0px;
}

h2.month {
  width: 100%;
  font: bold 13px/1 var(--font-sans);
  text-transform: uppercase;
  margin-top: 40px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#archive-list li:last-child {
  margin-bottom: 0;
}

#archive-list a {
  display: block;
  font: bold 17px/1.7 var(--font-sans);
  color: var(--fg-default);
}

#archive-list .dates {
  float: right;
  position: relative;
  top: 1px;
  font: 400 17px/1.7 var(--font-sans);
  color: var(--fg-muted);
}

#archive-list li a:hover,
#archive-list li:hover .dates {
  color: var(--accent);
}

.read-more {
  margin-top: 60px;
}

.read-more h3 {
  font: 400 20px var(--font-sans);
  margin-bottom: 20px;
}

.read-more a {
  font: 400 16px/1.6 var(--font-sans);
  color: var(--accent);
}

.read-more a:hover {
  opacity: 0.8;
}

.read-more .dates {
  font: 400 16px/1.6 var(--font-sans);
}

/* Media Queries */
@media screen and (max-width: 540px) {
  #wrapper {
    padding: 20px 20px 20px 20px;
  }
  .post {
    margin: 40px 0;
  }

  #post-list,
  #archive-list {
    margin-top: 0;
  }
  #post-meta {
    margin-top: 60px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  #title {
    font-size: 17px;
  }
  #post-list .dates {
    float: none;
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
  }

  nav.main-nav {
    gap: 0;
    flex-wrap: wrap;
  }

  nav.main-nav a {
    font-size: 13px;
    padding: 6px 8px;
  }

  .profile #wrapper {
    padding-top: 20px;
  }

  .profile #avatar {
    width: 80px;
    height: 80px;
  }

  #post-list-footer {
    margin-top: 20px;
    padding-top: 40px;
  }

  h1 {
    font-size: 26px;
  }
  .post h1 {
    font-size: 24px;
  }
  .post h2 {
    font-size: 20px;
  }
}

/* CUSTOM ADDITIONS */

#social {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

a.symbol {
  color: var(--fg-dim);
  text-decoration: none;
  margin: 0 0.4rem;
  display: inline-flex;
  align-items: center;
}

a.symbol svg {
  width: 24px;
  height: 24px;
}

a.symbol:hover {
  color: var(--fg-muted);
}

/* Post Meta */
.post-meta {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-faint);
  margin: -5px 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.post-meta .meta-sep {
  color: var(--fg-dim);
}

.post-meta time {
  color: inherit;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 40px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.tag:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

/* Source domain in post meta */
.source-domain {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-faint);
}

/* Link post styles */
.link-post .external-title {
  color: var(--fg-emphasis);
  text-decoration: none;
}

.link-post .external-title:hover {
  color: var(--accent);
}

.link-post .link-arrow {
  font-size: 0.75em;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.link-post .external-title:hover .link-arrow {
  opacity: 1;
}

/* Source callout at bottom of link posts */
.source-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 0;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-raised);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.source-callout:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
  color: var(--accent);
}

.source-callout-domain {
  font-family: var(--font-mono);
  color: var(--fg);
}

.source-callout-arrow {
  color: var(--accent);
  transition: transform 0.15s;
}

.source-callout:hover .source-callout-arrow {
  transform: translateX(3px);
}

/* About page */
.about header {
  padding-bottom: 20px;
}

.about-avatar {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
}

.about #post-body {
  text-align: center;
}

.about #social {
  margin-top: 20px;
}

/* Back navigation */
.post-nav-back {
  margin: 40px 0 0;
}

.post-nav-back a {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.post-nav-back a:hover {
  opacity: 0.8;
}

/* Link list improvements */
.link-list li {
  display: block;
}

.link-desc {
  font-size: 15px;
  color: var(--fg-faint);
  margin: 2px 0 0;
  line-height: 1.5;
}

.link-domain {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  display: block;
  margin-top: 4px;
}
