@import url("https://api.fontshare.com/v2/css?f[]=general-sans@500,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Fragment+Mono&display=swap");

:root {
  --fg: #111;
  --bg: #fdfdfd;
  --muted: #777;
  --line: #ddd;
  --gap: 15px;
  --edge-gap: 32px;
  --header-height: 34px;
  --content-max-width: 1130px;
  --rule-edge-gap: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #999 transparent;
}

::-webkit-scrollbar {
  width: 1.5px;
  height: 1.5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #999;
}


::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Fragment Mono", "JetBrains Mono", "SF Mono", "Courier New", monospace;
  font-size: clamp(13px, 0.65vw + 11px, 15px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

p {
  text-wrap: pretty;
}

h1, h2, h3, .page-title, .project-header h1 {
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
  transition: text-shadow 0.15s ease;
}

a:hover {
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.8), 0 0 7px rgba(0, 0, 0, 0.45);
}

.wrap {
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

main .wrap {
  max-width: var(--content-max-width);
}

header.site-header {
  flex-shrink: 0;
}

header.site-header .rule,
footer.site-footer .rule {
  width: calc(100% - (var(--rule-edge-gap) * 2));
  margin: 0 auto;
  border-bottom: 0.5px solid var(--fg);
}

header.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  flex-wrap: nowrap;
  gap: 12px;
}

.header-nav-overflow {
  display: none;
}

@media (max-width: 440px) {
  header.site-header nav.site-nav {
    display: none;
  }

  .header-nav-overflow {
    display: block;
  }

  .header-nav-overflow .wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: var(--header-height);
  }
}

.logo {
  font-family: "Fragment Mono", "JetBrains Mono", monospace;
  font-weight: 230;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: var(--fg);
}

nav.site-nav {
  display: flex;
  gap: 18px;
  font-size: 12px;
  margin-left: auto;
}

nav.site-nav a.active {
  font-weight: 700;
}

main {
  flex: 1 0 auto;
  padding: 56px 0 96px;
}

footer.site-footer {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}

footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-clock,
.footer-coords {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #bababa;
}

/* homepage */
main.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) 660px;
  gap: 16px;
  align-items: start;
}

.home-grid > .project-list,
.home-grid > .home-slideshow {
  min-width: 0;
}

.home-grid .project-list div {
  white-space: nowrap;
}

.home-slideshow {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.slideshow-frame {
  position: relative;
  display: block;
}

.slideshow-img {
  display: block;
  width: auto;
  height: 460px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.slideshow-img.is-fast {
  transition-duration: 0.1s;
}

.slideshow-img.is-fading {
  opacity: 0;
}

.slideshow-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.slideshow-nav-prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M12 4 L6 10 L12 16' stroke='white' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 4 L6 10 L12 16' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 10 10, w-resize;
}

.slideshow-nav-next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M8 4 L14 10 L8 16' stroke='white' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 4 L14 10 L8 16' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 10 10, e-resize;
}

.slideshow-caption {
  display: block;
  margin-top: 8px;
  width: 100%;
  text-align: right;
  color: var(--muted);
  font-size: 10px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.slideshow-caption.is-fast {
  transition-duration: 0.1s;
}

.slideshow-caption.is-fading {
  opacity: 0;
}

.inline-slideshow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 65px;
}

.project-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 32px 0 65px;
}

.project-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.gallery.inline-slideshow-hidden-gallery {
  display: none;
}

.inline-slideshow-frame {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.inline-slideshow-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  cursor: zoom-in;
  transition: opacity 0.5s ease;
}

.inline-slideshow-img.is-fast {
  transition-duration: 0.1s;
}

.inline-slideshow-img.is-fading {
  opacity: 0;
}

.inline-slideshow-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.inline-slideshow:hover .inline-slideshow-nav {
  opacity: 1;
}

@media (max-width: 935px) {
  main.home-main {
    flex-shrink: 1;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .home-grid .project-list div {
    white-space: normal;
  }

  .home-slideshow {
    width: 100%;
    align-items: flex-end;
  }

  .slideshow-frame {
    width: 100%;
  }

  .slideshow-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(320px, 38vh);
    aspect-ratio: 4 / 3;
    object-fit: contain;
    object-position: right center;
    margin-left: auto;
  }

  .slideshow-caption {
    display: none;
    text-align: right;
  }
}

/* projects list */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-list a {
  font-size: 12px;
}

.project-list.size-14 a {
  font-size: 14px;
}

.project-list .year {
  color: var(--muted);
}

.page-title {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 40px;
}

/* project detail pages */
.project-header h1 {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 4px;
}

.project-header .year {
  color: var(--muted);
  margin-bottom: 36px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.project-grid > .text-col,
.project-grid > .image-col {
  min-width: 0;
}

.project-text {
  max-width: 65ch;
  margin-bottom: 36px;
}

.text-col .project-text {
  max-width: none;
}

.project-text p {
  margin: 0 0 20px;
}

.project-text img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
}

.section-label {
  font-weight: 700;
  margin: 48px 0 20px;
}

.image-col .section-label {
  margin-top: 0;
}

.project-label {
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 8px;
}

.image-col .gallery {
  grid-template-columns: 1fr;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.gallery img {
  width: 100%;
  display: block;
  height: auto;
  cursor: zoom-in;
}

.gallery.single {
  grid-template-columns: 1fr;
  max-width: 640px;
}

.gallery.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
  .gallery, .gallery.cols-3 {
    grid-template-columns: 1fr;
  }
  nav.site-nav {
    gap: 14px;
  }
}

/* about page */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.about-grid > .bio,
.about-grid > .cv {
  min-width: 0;
}

.about-grid h2 {
  font-size: 13px;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.about-grid .bio p {
  margin: 0 0 18px;
}

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

.cv-entry {
  margin-bottom: 10px;
  padding-left: 7ch;
  text-indent: -7ch;
}

.cv-entry .d {
  color: var(--fg);
}

.cv-modified {
  margin-top: 48px;
  font-size: 11px;
  color: var(--muted);
}

.cv-modified .cv-year {
  font-weight: 400;
}

.cv-modified .cv-time {
  margin-top: 2px;
}

.cv-modified .cv-time .tab-gap {
  display: inline-block;
  width: 2.5em;
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* contact page */
.contact-block p {
  margin: 0 0 10px;
}

.contact-block a.underline {
  text-decoration: underline;
}

.contact-form {
  max-width: 420px;
  margin-top: 32px;
}

.contact-form .hidden-field {
  position: absolute;
  left: -9999px;
}

.contact-form label {
  color: var(--muted);
  font-size: 12px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 10px;
  margin-top: 4px;
}

.contact-form button {
  font-family: inherit;
  font-size: 14px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 10px 22px;
  cursor: pointer;
}

.contact-form button:hover {
  opacity: 0.85;
}

/* lightbox */
body.lightbox-active {
  overflow: hidden;
}

.lightbox-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  position: relative;
  overflow: hidden;
}

.lightbox-track {
  position: relative;
  display: flex;
  height: 100%;
  gap: 24px;
}

.lightbox-slide {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: none;
}

.lightbox-tap-left {
  left: 0;
  cursor: w-resize;
}

.lightbox-tap-right {
  right: 0;
  cursor: e-resize;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.lightbox-close {
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  padding: 12px;
  display: flex;
  align-items: center;
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.7;
}

@media (max-width: 600px) {
  .lightbox-prev,
  .lightbox-next {
    display: none !important;
  }

  .lightbox-tap {
    display: block;
  }
}


