:root {
  --bg: #faf8f4;
  --text: #1c1a17;
  --muted: #6b6660;
  --border: #e2ddd3;
  --accent: #9a3f2b;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: currentColor;
}

/* Header */

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  color: var(--text);
  border-bottom: none;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--text);
}

/* Main / sections */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

.work {
  border-bottom: none;
}

/* About */

.about {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}

.portrait {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.about h1 {
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}

.role {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.bio {
  margin: 0 0 1.25rem;
  max-width: 34em;
}

.links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.links a {
  font-size: 0.95rem;
}

/* Work */

.work h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

.tabs {
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0 0 0.75rem;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}

.projects[hidden] {
  display: none;
}

.project {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.project-text {
  grid-template-columns: 1fr;
}

.project-meta {
  margin: -0.25rem 0 0.5rem;
  color: var(--accent);
  font-size: 0.85rem;
}

.thumb {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  padding: 0;
  background: none;
  appearance: none;
  cursor: pointer;
}

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: opacity 0.15s;
}

.thumb:hover img {
  opacity: 0.9;
}

.thumb-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  cursor: default;
  line-height: normal;
}

.thumb-placeholder span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  color: var(--muted);
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.project-title-row h3 {
  margin-bottom: 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  border-bottom: none;
  transform: translateY(2px);
}

.icon-link:hover {
  color: var(--text);
  border-bottom: none;
}

.icon {
  width: 16px;
  height: 16px;
}

.icon-github {
  fill: currentColor;
}

.icon-external {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
}

.tech li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(20, 17, 13, 0.72);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(880px, 100%);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  appearance: none;
  background: none;
  border: none;
  color: #faf8f4;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  background: rgba(250, 248, 244, 0.9);
  border: 1px solid var(--border);
  color: var(--text);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-arrow:hover {
  background: #fff;
}

.lightbox-prev {
  left: -0.5rem;
}

.lightbox-next {
  right: -0.5rem;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #faf8f4;
  font-size: 0.95rem;
}

.lightbox-link {
  color: #faf8f4;
  border-bottom-color: currentColor;
}

/* Responsive */

@media (max-width: 620px) {
  .about {
    flex-direction: column;
  }

  .project {
    grid-template-columns: 1fr;
  }

  .lightbox-prev {
    left: 0.25rem;
  }

  .lightbox-next {
    right: 0.25rem;
  }
}
