:root {
  color-scheme: light;
  --background: #fbfbf8;
  --text: #292d30;
  --muted: #686d70;
  --rule: #d8d9d6;
  --link: #164e88;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.page {
  width: min(100% - 3rem, 720px);
  margin: 0 auto;
  padding: 3.1rem 0 2.7rem;
}

.site-header { margin-bottom: 2.65rem; }

.file-path, small { color: var(--muted); font-size: 0.8125rem; }
.list-meta { color: var(--muted); font-size: 0.875rem; }

h1, h2, h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

h2 { margin-top: 2.6rem; margin-bottom: 0.85rem; }
h3 { margin-top: 1.8rem; margin-bottom: 0.75rem; }

.home h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.home #content > p:first-of-type { font-size: 1.0625rem; }
.home #content > h2:first-of-type { clear: both; }

.profile-photo {
  float: right;
  width: 220px;
  height: 220px;
  margin: 0 0 1.5rem 2rem;
  border-radius: 8px;
  overflow: hidden;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
  transform-origin: center 38%;
}

.heading-mark { color: var(--muted); font-weight: 400; }

p { margin: 0 0 1.25rem; }

ul { margin: 0 0 1.45rem; padding-left: 1.75rem; }
li { padding-left: 0.15rem; margin: 0.25rem 0; }
li::marker { color: var(--muted); }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.16em; }
a:hover { color: #0b3765; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 1px; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.35rem 0; }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.25rem;
  padding-top: 1.2rem;
}

.site-footer nav { font-size: 0.875rem; margin-bottom: 0.65rem; }
.site-footer nav span { color: var(--muted); padding: 0 0.38rem; }
.site-footer small { display: block; }

@media (max-width: 600px) {
  .page { width: min(100% - 2.25rem, 720px); padding-top: 1.7rem; padding-bottom: 2rem; }
  .site-header { margin-bottom: 2rem; }
  h2 { margin-top: 2.2rem; }
  .profile-photo { float: none; width: 180px; height: 180px; margin: 0 0 1.5rem; }
}


.project-photo { margin: 1.6rem 0 2.2rem; }
.project-photo img { display: block; width: 100%; height: auto; }
.project-photo figcaption { color: var(--muted); font-size: 0.8125rem; margin-top: 0.65rem; line-height: 1.6; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.3rem 0 2rem;
}

.gallery-item {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e9e9e5;
  border-radius: 3px;
  cursor: zoom-in;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery-item:hover img { transform: scale(1.04); }

.photo-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 3.5rem 3.75rem;
  border: 0;
  background: #15181b;
  color: white;
}

.photo-lightbox[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.photo-lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.photo-lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; }
.photo-lightbox button {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox button:hover { background: rgba(255, 255, 255, 0.25); }
.photo-lightbox button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.lightbox-close { top: 0.8rem; right: 1rem; }
.lightbox-prev { left: 0.6rem; top: calc(50% - 1.375rem); }
.lightbox-next { right: 0.6rem; top: calc(50% - 1.375rem); }

@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .photo-lightbox { padding: 3.5rem 0.7rem; }
  .photo-lightbox img { max-height: calc(100dvh - 7rem); }
  .lightbox-prev { left: 0.5rem; top: auto; bottom: 0.8rem; }
  .lightbox-next { right: 0.5rem; top: auto; bottom: 0.8rem; }
}
