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

html {
  background: var(--bg-color);
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-bright);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.7;
}

a:focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 3px;
}

img {
  max-width: 100%;
}

.mono {
  font-family: var(--font-mono);
}

/* Layout */

.shell {
  max-width: 712px;
  margin: 0 auto;
  padding: 0 16px 64px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 16px var(--font-display);
}

.site-logo {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.nav-bar {
  display: flex;
  gap: 24px;
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
}

.nav-bar a {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-bar a.nav-active {
  color: var(--text-bright);
}

.nav-bar a.nav-active::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent-color);
}

/* Home intro */

.intro {
  margin-top: 72px;
}

.intro-text {
  margin: 0;
  font: 400 18px/1.6 var(--font-display);
  color: var(--text-lead);
  text-wrap: pretty;
}

.intro-name {
  color: var(--text-bright);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
}

.link-row a:first-child {
  color: var(--text-bright);
}

/* Sections */

.section {
  margin-top: 72px;
}

.section + .section {
  margin-top: 56px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-strong);
}

.section-title {
  margin: 0;
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
}

.section-link {
  font: 400 13px var(--font-mono);
  color: var(--text-dim);
}

/* Project rows */

.project-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.project-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.project-name {
  margin: 0;
  font: 500 17px var(--font-display);
}

.project-lang {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font: 400 12px var(--font-mono);
  color: var(--text-muted);
}

.lang-dot {
  width: 7px;
  height: 7px;
  background: var(--lang-default);
}

.lang-cpp .lang-dot { background: var(--lang-cpp); }
.lang-rust .lang-dot { background: var(--lang-rust); }
.lang-js .lang-dot { background: var(--lang-js); }
.lang-csharp .lang-dot { background: var(--lang-csharp); }
.lang-python .lang-dot { background: var(--lang-python); }

.project-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 6px;
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
}

.project-links a:first-child {
  color: var(--text-bright);
}

/* Post rows */

.post-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.post-row-date {
  font: 400 12px var(--font-mono);
  color: var(--text-dim);
}

.post-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-row-title {
  font-size: 16px;
}

.post-row-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Page / post header */

.page-header {
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header h1 {
  margin: 0;
  font: 500 30px/1.25 var(--font-display);
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.page-meta {
  font: 400 12px var(--font-mono);
  color: var(--text-dim);
}

.page-subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.page-header + .section {
  margin-top: 40px;
}

/* Prose (Markdown) */

.prose {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font: 400 16px/1.75 var(--font-sans);
  color: var(--text-body);
}

.prose > * {
  margin: 0;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-bright);
}

.prose h2 { font-size: 20px; }
.prose h3 { font-size: 17px; }
.prose h4 { font-size: 15px; }

.prose p,
.prose li {
  text-wrap: pretty;
}

.prose a {
  color: var(--text-bright);
  border-bottom: 1px solid var(--accent-color);
}

.prose strong {
  color: var(--text-bright);
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--text-dim);
}

.prose blockquote {
  padding-left: 16px;
  border-left: 1px solid var(--accent-color);
  color: var(--text-muted);
}

.prose hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-strong);
}

.prose picture,
.prose img {
  display: block;
  width: 100%;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 8px 12px 8px 0;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.prose th {
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
  border-bottom-color: var(--border-strong);
}

/* Post navigation */

.post-nav {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font: 400 13px var(--font-mono);
  color: var(--text-muted);
}

.post-nav a:last-child:not(:first-child) {
  text-align: right;
}

/* About */

.about-lead {
  margin: 40px 0 0;
  font: 400 18px/1.6 var(--font-display);
  color: var(--text-lead);
  text-wrap: pretty;
}

.about-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.about-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.about-item-title {
  margin: 0;
  font: 500 17px var(--font-display);
}

.about-item-period {
  flex-shrink: 0;
  font: 400 12px var(--font-mono);
  color: var(--text-dim);
}

.about-item-sub {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.about-bullets {
  margin: 12px 0 0;
  padding-left: 1.25em;
  font: 400 15px/1.7 var(--font-sans);
  color: var(--text-body);
}

.about-bullets li::marker {
  color: var(--text-dim);
}

/* Key / value rows (stack, contact) */

.kv-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.kv-label {
  font: 400 12px var(--font-mono);
  color: var(--text-dim);
}

.kv-value {
  font-size: 16px;
}

/* Footer */

.site-footer {
  margin-top: 72px;
  display: flex;
  justify-content: space-between;
  font: 400 12px var(--font-mono);
  color: var(--text-dim);
}
