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

/* Base Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fafafa;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Headings */
h1, h2, h3 {
  line-height: 1.3;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.25rem;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
}

/* Links */
a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
nav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  font-weight: 500;
  color: #444;
}

nav ul li a:hover {
  color: #111;
  text-decoration: none;
}

nav ul li.active a {
  color: #111;
  font-weight: 600;
}

/* Sections */
section {
  margin-bottom: 3rem;
}

/* Contact Links */
.contact-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-links li a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid #d4d4d5;
  border-radius: 4px;
  font-size: 0.875rem;
}

.contact-links li a:hover {
  background-color: #f4f4f5;
  text-decoration: none;
}

/* Entry Cards (Writings/Projects) */
.entry {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.entry:last-child {
  border-bottom: none;
}

.entry h3 {
  margin-bottom: 0.25rem;
}

.entry h3 a {
  color: #111;
}

.entry h3 a:hover {
  color: #2563eb;
}

.entry .date {
  font-size: 0.875rem;
  color: #737373;
  margin-bottom: 0.5rem;
}

.entry .description {
  color: #525253;
}

.entry .external-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* Section headings */
.section-title {
  margin-bottom: 1.5rem;
}

/* Edge Cases */
.entry h3 a,
.entry .description {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.entry .description {
  -webkit-line-clamp: 2;
}

.single-entry .content {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Mobile responsive */
@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem;
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.25rem;
  }

  nav ul li a {
    display: block;
    padding: 0.625rem 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .contact-links {
    flex-wrap: wrap;
  }

  .contact-links li a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .entry {
    padding-bottom: 1.25rem;
  }

  .entry h3 a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .entry .external-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
  }
}
