@font-face {
  font-family: '0xProto';
  src: url('../fonts/0xProtoNerdFont-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0d0d;
  --bg-alt: #141414;
  --fg: #c0c0c0;
  --fg-muted: #666;
  --accent: #7aa2f7;
  --accent-dim: #3b5ea6;
  --border: #222;
  --font: '0xProto', 'Courier New', monospace;
  --max-w: 720px;
  --zen-w: 65ch;
  --lh: 1.7;
  --lh-zen: 1.9;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.site-header {
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.site-logo {
  color: var(--fg);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--accent);
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

nav a:hover,
nav a.active {
  color: var(--fg);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem;
}

footer {
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Home */

.intro {
  margin-bottom: 3rem;
}

.intro h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.intro p {
  color: var(--fg-muted);
  max-width: 55ch;
}

.intro-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.recent-posts h2 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

/* Blog list */

.post-list {
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-date {
  color: var(--fg-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-title {
  color: var(--fg);
  font-size: 0.95rem;
}

.post-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-excerpt {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Blog post */

.post-header {
  margin-bottom: 3rem;
}

.post-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-meta {
  color: var(--fg-muted);
  font-size: 0.8rem;
  display: flex;
  gap: 1.5rem;
}

.post-content {
  max-width: var(--max-w);
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content h2 {
  font-size: 1.05rem;
  margin: 2.5rem 0 0.75rem;
  color: var(--fg);
}

.post-content h3 {
  font-size: 0.95rem;
  margin: 2rem 0 0.5rem;
  color: var(--fg);
}

.post-content code {
  background: var(--bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  font-size: 0.88em;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg-alt);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 2px solid var(--accent-dim);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--fg);
  font-size: 0.85rem;
}

.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  color: var(--fg-muted);
  margin: 1.5rem 0;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 2rem;
}

.post-nav-prev,
.post-nav-next {
  color: var(--fg-muted);
}

.post-nav-next {
  text-align: right;
}

/* Portfolio */

.portfolio-section {
  margin-bottom: 4rem;
}

.portfolio-section h2 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.project-item h3 a {
  color: var(--fg);
}

.project-item h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-item p {
  color: var(--fg-muted);
  font-size: 0.88rem;
}

.writing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.writing-list li {
  font-size: 0.9rem;
}

.writing-list .writing-meta {
  color: var(--fg-muted);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
}

.experience-dates {
  color: var(--fg-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.experience-role {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
}

.experience-company {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.experience-desc {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* Zen mode */

.zen-toggle {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.zen-toggle:hover {
  color: var(--fg);
}

body.zen .site-header,
body.zen footer,
body.zen .post-nav,
body.zen .zen-toggle-wrap {
  display: none;
}

body.zen main {
  max-width: var(--zen-w);
  padding: 6rem 2rem;
  margin: 0 auto;
  line-height: var(--lh-zen);
}

body.zen .post-header h1 {
  font-size: 1.2rem;
}

.zen-exit {
  display: none;
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

body.zen .zen-exit {
  display: block;
}

.zen-exit:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

/* Mobile */

@media (max-width: 600px) {
  .site-header {
    padding: 1rem 1.25rem;
  }

  nav {
    gap: 1.25rem;
  }

  main {
    padding: 2rem 1.25rem;
  }

  .post-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
