/* Laid out one to one like alejorestrepo.me: light by default, dark with the system. */
:root { --bg: #ffffff; --text: #1a1a1a; --muted: #767676; --rule: #e4e4e4; --frame: #f4f4f4; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f0f; --text: #e8e8e8; --muted: #8c8c8c; --rule: #262626; --frame: #171717; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: currentColor; }
img { max-width: 100%; }
figure { margin: 0; }

/* inner pages: back link, narrow column */
.nav-wrapper { max-width: 40rem; margin: 0 auto; padding: 3rem 1.5rem 0; }
.top-nav { display: block; }
.nav-brand { font-size: 0.9375rem; color: var(--muted); border: none; }
.nav-brand:hover { color: var(--text); border: none; }
.nav-brand::before { content: "← "; }
.page { max-width: 40rem; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.project-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin: 0 0 0.75rem; }
.project-meta { display: flex; flex-direction: column; gap: 0.2rem; color: var(--muted); font-size: 0.875rem; margin: 0 0 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.project-meta strong { font-weight: 500; color: var(--muted); }
.phase-heading { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 3rem 0 0.9rem; }
h2, h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; margin: 2rem 0 0.6rem; }
p { margin: 0 0 0.9rem; }
ul, ol { margin: 0 0 0.9rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }
pre { overflow-x: auto; background: var(--frame); padding: 0.8rem 1rem; font-size: 0.875rem; }
blockquote { margin: 0 0 0.9rem; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prose a { color: rgb(26, 13, 171); }
@media (prefers-color-scheme: dark) { .prose a { color: rgb(91, 156, 246); } }

/* pictures */
.media-frame, .hero-media { margin: 1.6rem 0 0.5rem; overflow: hidden; }
.media-frame img { display: block; width: auto; max-width: 100%; height: auto; max-height: 30rem; margin: 0 auto; }
.hero-media img { width: 100%; max-height: none; }
.media-caption { color: var(--muted); font-size: 0.875rem; line-height: 1.5; margin: 0 0 1.8rem; text-align: left; }

/* work log on project pages */
.lib-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.5rem; }
.lib-tag { padding: 0.15rem 0.5rem; font: inherit; font-size: 0.8125rem; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 0; cursor: pointer; }
.lib-tag:hover { color: var(--text); }
.lib-tag.is-on { color: var(--bg); background: var(--text); border-color: var(--text); }
.steps { list-style: none; padding: 0; margin: 0; }
.step { padding: 0 0 0.6rem; border-top: 1px solid var(--rule); margin: 0; }
.step[hidden] { display: none; }
.step h3 { margin: 1.1rem 0 0.4rem; }
.step-meta { font-weight: 400; color: var(--muted); font-size: 0.875rem; margin-left: 0.4rem; white-space: nowrap; }
.step p { color: var(--muted); }
.step .learned { color: var(--text); }
.step .learned strong { font-weight: 500; color: var(--muted); }

/* home */
main { max-width: 40rem; margin: 0 auto; padding: 5rem 1.5rem 6rem; }
body.home main { max-width: 46rem; padding: 3.5rem 1.5rem 4rem; }
h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.section-label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 3rem 0 0.9rem; }
body.home .section-label { margin: 2.2rem 0 0.6rem; }
.section-label a { color: var(--text); border-bottom-color: var(--rule); }
.section-label a:hover { border-bottom-color: currentColor; }
.intro { display: grid; grid-template-columns: 1fr 12rem; gap: 1.75rem; align-items: center; }
.intro.no-photo { grid-template-columns: 1fr; }
.intro .photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.bio { max-width: 34rem; color: var(--muted); }
.bio a { color: var(--text); }
.bio p { margin: 0; }
.links { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.9375rem; }
.links a { margin-right: 0.35rem; border: none; color: var(--text); }
.links a:hover { border-bottom: 1px solid; }
.links a + a::before { content: " ·"; color: var(--muted); }
.note { display: block; color: var(--muted); font-size: 0.9375rem; }
body > footer { max-width: 40rem; margin: 0 auto; padding: 1.2rem 1.5rem 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.875rem; }
body.home > footer { max-width: 46rem; }
main > ul { list-style: none; padding: 0; }
main > ul > li { position: relative; padding-left: 1.1rem; margin-bottom: 0.65rem; color: var(--muted); }
main > ul > li a { color: var(--text); }
main > ul > li::before { content: "‣"; position: absolute; left: 0; color: var(--muted); }
main > ul > li strong { color: var(--text); font-weight: 600; }

.projects { list-style: none; padding: 0; margin: 0; }
.projects > li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.1rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--rule); margin-bottom: 0; }
.projects > li::before { content: none; }
.projects > li:first-child { border-top: none; padding-top: 0.2rem; }
.projects .thumb { width: 8.5rem; aspect-ratio: 16 / 10; background: var(--frame); overflow: hidden; }
.projects .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.projects .thumb.empty { background: none; }
.projects .title { font-weight: 600; color: var(--text); }
.projects .title a { border-bottom-color: var(--rule); }
.projects .when, .cv .when { color: var(--muted); font-size: 0.875rem; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.projects > li > div, .row-head > span { min-width: 0; }
.row-head .when { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.projects .note, .cv .note { font-size: 0.875rem; line-height: 1.5; margin-top: 0.15rem; }
main > ul.cv, .page ul.cv { list-style: none; padding: 0; margin: 0; }
main > ul.cv > li { padding-left: 0; margin-bottom: 0.45rem; color: var(--text); }
main > ul.cv > li::before { content: none; }
.cv .note { display: block; color: var(--muted); }
.cv .when a { color: var(--muted); border-bottom-color: var(--rule); }
.cv .when a:hover { color: var(--text); }
main > ul.cv.library > li { color: var(--muted); }

@media (max-width: 600px) {
  .nav-wrapper { padding-top: 2rem; }
  .intro { grid-template-columns: 1fr; }
  .intro .photo { width: 10rem; order: -1; }
  .projects > li { grid-template-columns: 6rem 1fr; gap: 0.9rem; align-items: start; }
  .projects .thumb { width: 6rem; }
  .projects .thumb.empty { display: none; }
  .projects > li:has(.thumb.empty) { grid-template-columns: 1fr; }
  .row-head { flex-direction: column; gap: 0; }
}
