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

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-code: "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-link: #1a1a1a;
  --color-accent: #FFD900;
  --color-bg: #fff;
  --max-width: 550px;
  --spacing-unit: 1rem;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgb(17, 17, 17);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.125rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 500;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

p {
  margin-bottom: 1rem;
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.header .name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgb(17, 17, 17);
  margin-bottom: 0;
}

.header time {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgba(0, 0, 0, 0.4);
  display: block;
}

/* Links */
a {
  color: rgb(36, 128, 237);
  text-decoration: none;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

a::after {
  content: " ↗";
  font-size: 0.75em;
  position: relative;
  top: -0.3em;
}

/* About */
.about {
  margin-bottom: 1rem;
}

.links-row {
  color: rgba(0, 0, 0, 0.4);
}

/* Writing section */
.writing-list {
  list-style: none;
}

.writing-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.writing-year {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgba(0, 0, 0, 0.4);
  min-width: 40px;
}

.writing-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.writing-title a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  letter-spacing: -0.09px;
  line-height: normal;
  color: rgb(17, 17, 17);
  text-decoration: none;
  transition: opacity 0.14s ease;
}

.writing-title a:hover {
  opacity: 0.6;
}

.writing-title a::after {
  display: none;
}

.writing-date {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgba(0, 0, 0, 0.4);
}

.new-marker {
  background: rgba(255, 217, 0, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  margin-left: 0.5rem;
  color: rgb(17, 17, 17);
}

/* Work section */
.work-list {
  list-style: none;
}

.work-item {
  margin-bottom: 1.5rem;
}

.work-title {
  font-family: var(--font-sans);
  font-weight: 600;
}

.work-role {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.work-description {
  font-size: 0.9375rem;
  margin-top: 0.5rem;
}

.work-description ul {
  margin-left: 1.25rem;
  margin-top: 0.25rem;
}

.work-description li {
  margin-bottom: 0.25rem;
}

/* Projects */
.projects-list {
  list-style: none;
}

.project-item {
  margin-bottom: 1rem;
}

.project-name {
  font-family: var(--font-sans);
  font-weight: 600;
}

.project-description {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Education */
.education-list {
  list-style: none;
}

.education-item {
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
}

.education-degree {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer p {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 0;
}

.footer a {
  color: rgba(0, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    margin-top: 2rem;
  }
}

/* Blog post layout */
.post-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  position: relative;
}

.post-sidebar {
  width: 200px;
  position: absolute;
  right: calc(100% + 2rem);
  top: 4rem;
}

.sidebar-index {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 460;
  letter-spacing: -0.04px;
  line-height: 15.6px;
  color: rgba(18, 18, 18, 0.4);
  text-decoration: none;
  display: block;
  margin-bottom: 2rem;
  transition: color 0.1s ease;
}

.sidebar-index:hover {
  color: rgb(18, 18, 18);
}

.sidebar-index::after {
  display: none;
}

.post-toc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 460;
  letter-spacing: -0.04px;
  line-height: 15.6px;
  color: rgba(18, 18, 18, 0.4);
  text-decoration: none;
  transition: color 0.1s ease;
}

.toc-link:hover {
  color: rgb(18, 18, 18);
}

.toc-link::after {
  display: none;
}

.post-main {
  width: 100%;
}

@media (max-width: 900px) {
  .post-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 2rem;
  }

  .post-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

/* Blog post page styles */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-date {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.post-content {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 460;
  line-height: 20px;
  letter-spacing: -0.09px;
  color: rgb(17, 17, 17);
}

.post-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.post-content p {
  padding-top: 0;
  margin-bottom: 16px;
}

.post-content h2 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.13px;
  line-height: normal;
  color: rgb(17, 17, 17);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  margin-bottom: 16px;
  padding-top: 16px;
}

.post-content h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

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

.post-content code {
  font-family: var(--font-code);
  font-size: 0.875em;
  background: #f5f5f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.post-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.back-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  display: block;
}
