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

html {
  font-size: 17px;
  background: #0f0f0f;
}

body {
  color: #d4d4d4;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.75;
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

a {
  color: #7eb8f7;
  text-underline-offset: 3px;
}

a:hover {
  color: #a8d0ff;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 1.5rem;
}

/* ── Home: social icon buttons ── */

.social {
  display: flex;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #d4d4d4;
  text-decoration: none;
}

.social a:hover {
  color: #f0f0f0;
}

.social svg {
  fill: currentColor;
  display: block;
}

/* ── Back link (notebook index, projects index, project page) ── */

.back {
  display: block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* ── Entry navigation bar (prev / notebook / next) ── */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

.nav-prev {
  flex: 1;
}

.nav-center {
  flex: 1;
  text-align: center;
}

.nav-next {
  flex: 1;
  text-align: right;
}

/* ── Entry title and date ── */

.entry-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.entry-date {
  font-size: 0.85rem;
  color: #555555;
  margin-bottom: 2.5rem;
}

/* ── Notebook / Projects list table ── */

.list {
  width: 100%;
  border-collapse: collapse;
}

.list td {
  padding: 0.45rem 0;
  vertical-align: top;
}

.list .date {
  color: #555555;
  white-space: nowrap;
  padding-right: 2rem;
  font-size: 0.88rem;
  width: 120px;
}

.list .desc {
  color: #888888;
  font-size: 0.92rem;
}

/* ── Prose ── */

.prose p {
  margin-bottom: 1.25rem;
}

.prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f0f0f0;
  margin: 2rem 0 0.6rem;
  letter-spacing: normal;
  text-transform: none;
}

.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0f0;
  margin: 1.5rem 0 0.5rem;
}

.prose blockquote {
  border-left: 3px solid #2a2a2a;
  padding-left: 1rem;
  color: #888888;
  margin: 1.25rem 0;
}

.prose hr {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 2.5rem 0;
}

.prose code {
  background: #1a1a1a;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.87em;
}

.prose pre {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.87rem;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose figure {
  margin: 1.5rem 0;
}

.prose figure img {
  max-width: 100%;
  display: block;
  border-radius: 4px;
}

.prose figcaption {
  font-size: 0.82rem;
  color: #555555;
  margin-top: 0.4rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin-bottom: 1.25rem;
}

.prose li {
  margin-bottom: 0.25rem;
}

.prose a {
  color: #7eb8f7;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #a8d0ff;
}

/* ── Mobile ── */

@media (max-width: 600px) {
  body {
    padding: 2.5rem 1.2rem 4rem;
  }
}

/* ── Portfolio: section heading ── */

h2 {
  font-size: 0.72rem;
  font-weight: 600;
  color: #555555;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

/* ── Portfolio: intro ── */

.name {
  font-size: 2rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 0.92rem;
  color: #555555;
  margin-bottom: 1.1rem;
}

.bio {
  margin-bottom: 1.5rem;
}

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

/* ── Portfolio: section spacing ── */

.section {
  margin-top: 4rem;
}

/* ── Portfolio: project block ── */

.project {
  margin-bottom: 2.75rem;
}

.project:last-child {
  margin-bottom: 0;
}

.project-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 0.3rem;
}

.project-name a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s;
}

.project-name a:hover {
  opacity: 0.7;
}

.project-desc {
  color: #555555;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.chip {
  font-size: 0.75rem;
  color: #555555;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 0.1em 0.5em;
}

.project-links {
  display: flex;
  gap: 1rem;
  font-size: 0.88rem;
}

/* ── Portfolio: open source ── */

.section-intro {
  color: #555555;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

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

.os-item {
  margin-bottom: 1.75rem;
}

.os-item:last-child {
  margin-bottom: 0;
}

.os-repo {
  font-weight: 600;
  color: #f0f0f0;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.os-desc {
  font-size: 0.88rem;
  color: #555555;
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.os-link {
  font-size: 0.85rem;
}

/* ── Portfolio: stack ── */

.stack-group {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: baseline;
  gap: 0 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.stack-label {
  color: #555555;
}

/* ── Portfolio: education ── */

.edu-item {
  margin-bottom: 1.25rem;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-degree {
  color: #d4d4d4;
  font-size: 0.9rem;
}

.edu-meta {
  font-size: 0.85rem;
  color: #555555;
  margin-top: 0.1rem;
}

/* ── Portfolio: footer ── */

.footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #555555;
}
