:root {
  --bg-color: #f5ebe0;
  --text-color: #3b2f25;
  --muted-text: #6f5f55;
  --card-color: #fcf6e8;
  --link-hover: #0066cc;
  --border-color: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 40px auto;
  max-width: 900px;
  line-height: 1.6;
  font-size: 18px;
  color: var(--text-color);
  padding: 0 24px 80px;
  background-color: var(--bg-color);
  font-family: 'EB Garamond', serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:root.dark-mode {
  --bg-color: #0f0f0f;
  --text-color: #f5ebe0;
  --muted-text: #cfc5b9;
  --card-color: #1b1b1b;
  --border-color: rgba(255, 255, 255, 0.15);
}

main {
  width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

p {
  margin: 0 0 1rem 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: inherit;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.site-nav-links {
  display: flex;
  gap: 18px;
}

.site-nav-links a {
  text-decoration: none;
  color: inherit;
  font-size: 1.5rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  border-bottom-color: currentColor;
}

.site-nav-links a.is-active {
  border-bottom-color: currentColor;
}

.theme-toggle {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle .toggle-icon {
  font-size: 1.2rem;
  line-height: 1;
  color: currentColor;
}

.page-header {
  margin-bottom: 36px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-row h1 {
  margin: 0;
}

.about-section {
  margin-bottom: 32px;
}

.profile-photo {
  width: 250px;
  height: 250px;
  border-radius: 6px;
  object-fit: cover;
  border: 3px solid var(--border-color);
  display: block;
  margin: 0 0 20px 0;
}

.section-heading {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.updates {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.updates li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  margin-bottom: 10px;
}

.update-date {
  font-weight: 600;
  white-space: nowrap;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
}

.favorites-inline {
  margin: 12px 0 0;
}

.favorites-inline a {
  text-decoration: underline;
}

.favorites-inline a:hover,
.favorites-inline a:focus-visible {
  color: var(--link-hover);
}

.blog-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-post {
  display: block;
  padding: 8px 20px 20px;
  background-color: var(--card-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.blog-post:hover,
.blog-post:focus-visible {
  border-color: var(--text-color);
  transform: translateY(-2px);
  text-decoration: none;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.post-header h2 {
  margin: 0;
}

.post-date,
.article-meta {
  color: var(--muted-text);
  font-size: 0.95rem;
}

.article-card {
  padding: 28px;
  background-color: var(--card-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.article-content p,
.article-content ul,
.article-content ol {
  margin-bottom: 1.2rem;
}

.article-content img {
  border-radius: 12px;
}

footer {
  margin-top: 48px;
  text-align: center;
  color: var(--muted-text);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  body {
    margin: 24px auto;
    padding: 0 12px 48px;
  }

  .profile-photo {
    width: 100%;
    height: auto;
    margin: 0 0 16px 0;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav-links {
    flex-wrap: wrap;
  }

  .blog-post,
  .article-card {
    padding: 18px;
  }
}

.sr-only {
  border: 0;
  padding: 0;
  margin: 0;
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
