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

:root {
  --accent: #b5392a;
  --accent-hover: #922e22;
  --text-primary: #1a1917;
  --text-secondary: #3d3b38;
  --text-tertiary: #888580;
  --border: rgba(0, 0, 0, 0.11);
  --bg: #f5f3ef;
  --bg-secondary: #edeae4;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --accent: #d4604f;
  --accent-hover: #df7a6b;
  --text-primary: #edebe7;
  --text-secondary: #b0ada8;
  --text-tertiary: #6e6b66;
  --border: rgba(255, 255, 255, 0.1);
  --bg: #1a1917;
  --bg-secondary: #22201e;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.site {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Nav */

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4rem;
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.nav-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-name:hover {
  text-decoration: none;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections */

.section {
  display: none;
}

.section.active {
  display: block;
}

/* Home */

.home-bio {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.headshot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  opacity: 0.92;
}

.bio-text h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 1rem;
}

.bio-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.85rem;
}

.bio-text p:last-child {
  margin-bottom: 0;
}

/* Section title */

.section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 0.5px solid var(--border);
}

/* Portfolio */

.portfolio-group {
  margin-bottom: 2.5rem;
}

.portfolio-group-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
}

.portfolio-item {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 0.5px solid var(--border);
  align-items: flex-start;
}

.portfolio-item:last-child {
  border-bottom: none;
}

.portfolio-item-tag {
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 110px;
  flex-shrink: 0;
  padding-top: 2px;
}

.portfolio-item-title {
  font-size: 14px;
  line-height: 1.5;
}

.portfolio-item-title a {
  color: var(--accent);
}

.portfolio-item-title a:hover {
  text-decoration: underline;
}

.portfolio-item-title-plain {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.portfolio-item-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.5;
}

/* Blog */

.blog-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

.blog-list {
  display: flex;
  flex-direction: column;
}

.blog-item {
  padding: 1.1rem 0;
  border-bottom: 0.5px solid var(--border);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  align-items: baseline;
}

.blog-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.blog-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 400;
  text-decoration: none;
}

.blog-title:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Resume */

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

.download-link:hover {
  text-decoration: underline;
}

.download-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.res-block {
  margin-bottom: 2.5rem;
}

.res-block-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 0.5px solid var(--border);
}

.res-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin-bottom: 1.25rem;
}

.res-role {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.res-date {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-top: 1px;
}

.res-org {
  font-size: 13px;
  color: var(--text-secondary);
  grid-column: 1;
}

.res-bullets {
  grid-column: 1 / -1;
  margin-top: 5px;
  padding-left: 1rem;
}

.res-bullets li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 3px;
}

.res-inline {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 4px;
  grid-column: 1 / -1;
}

.skills-list {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 2;
}

/* Footer */

.footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer p {
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer a {
  font-size: 12px;
  color: var(--accent);
}

.footer a:hover {
  text-decoration: underline;
}

/* Blog post pages */

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
  text-decoration: none;
}

.post-back:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-back svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  display: block;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0;
}

.post-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.85;
}

.post-body p {
  margin-bottom: 1.4rem;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-body a {
  color: var(--accent);
}

.post-body h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body strong {
  color: var(--text-primary);
  font-weight: 500;
}

.post-body em {
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: 2rem 0;
}

/* Responsive */

@media (max-width: 540px) {
  .nav {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .home-bio {
    flex-direction: column;
    gap: 1.25rem;
  }

  .portfolio-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .portfolio-item-tag {
    min-width: unset;
  }

  .blog-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .res-entry {
    grid-template-columns: 1fr;
  }

  .res-date {
    grid-column: 1;
  }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}
