@font-face {
  font-family: "Linux Libertine Display G";
  src: url("assets/fonts/LinLibertine_DR_G.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --page-margin: 250px;
  --rules-gap: 880px; /* Horizontal distance between the vertical black rules. */
  --type-size: 54pt;
  --header-bottom-space: 24px;
  --ink: #000;
  --paper: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Linux Libertine Display G", "Times New Roman", serif;
  font-size: var(--type-size);
  font-weight: 400;
  overflow-x: clip;
}

.portfolio-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rules-gap);
  height: 100vh;
  height: 100svh;
  grid-template-rows: minmax(0, 1fr);
  margin-inline: var(--page-margin);
}

/* The logo occupies the left column; the rules frame the right column.
   The right rule is on the right page margin, with the left rule 880px before it. */
.portfolio-layout::before,
.portfolio-layout::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink);
  pointer-events: none;
  z-index: 2;
}

.portfolio-layout::before {
  left: calc(100% - var(--rules-gap));
}

.portfolio-layout::after {
  left: 100%;
}

.site-header {
  --wordmark-size: 56pt; /* Responsive point size is set in sketch.js. */
  position: relative;
  z-index: 10;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: start;
  height: 100%;
  min-height: 0;
  padding-top: 24px;
  padding-right: 32px;
  padding-bottom: calc(var(--header-bottom-space) * 2);
}

.wordmark {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  /* Scale with the available column width, leaving 32px before the rule. */
  font-size: var(--wordmark-size); /* Previous size + 2pt. */
  line-height: 1;
  white-space: nowrap;
}

.site-header > .wordmark {
  position: fixed;
  top: 24px;
  left: var(--page-margin);
  z-index: 10;
  isolation: isolate;
}

/* Reserve the original wordmark height so fixing it does not move other content. */
.site-header::before {
  content: "";
  display: block;
  height: 1em;
  flex-shrink: 0;
  font-size: var(--wordmark-size);
}

.site-header > .wordmark::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -1;
  background: #fff;
  pointer-events: none;
}

.portfolio-content {
  width: var(--rules-gap);
  min-width: 0;
  min-height: 0;
}

.site-navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 32px;
  font-size: calc(var(--wordmark-size) - 8pt);
  line-height: 1.2;
}

.site-navigation a {
  color: inherit;
  text-decoration: none;
}

.site-navigation a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-navigation a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.site-footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: calc(var(--wordmark-size) / 2);
  line-height: 1.3;
  color: #555;
  overflow-wrap: anywhere;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

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

.project-stage {
  position: relative;
  height: 100%;
  overflow: clip;
}

.project-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 48px;
  transform: translateY(100svh);
}

.project-placeholder {
  position: relative;
  display: block;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9; /* 880px wide → 495px high on desktop. */
  background: var(--placeholder-color);
}

.project-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Previous Work presents one project at a time in a horizontal gallery. */
.work-header {
  position: relative;
  top: 0;
  left: auto;
  margin-inline: var(--page-margin);
  width: calc(100% - 2 * var(--page-margin) - var(--rules-gap));
  height: auto;
}

.work-showcase {
  position: relative;
  margin-inline: var(--page-margin);
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.work-gallery {
  display: flex;
  gap: 48px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.work-gallery::-webkit-scrollbar {
  display: none;
}

.work-entry {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: start;
}

.gallery-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  color: #000;
  font-size: 14pt;
}

.gallery-controls button {
  font: inherit;
  font-size: 22pt;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 8px 16px;
  cursor: pointer;
}

.gallery-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.work-entry .project-placeholder {
  width: 100%;
}

.project-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgb(200 200 200 / 18%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.work-entry:hover .project-hover-overlay {
  opacity: 1;
}

.work-entry:focus-within .project-hover-overlay {
  opacity: 1;
}

.project-placeholder:focus-visible {
  outline: 2px solid #000;
  outline-offset: -6px;
}

.project-legend {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #000;
  font-size: 14pt;
  line-height: 1.3;
}

.project-legend-title {
  font-weight: 600;
}

.project-legend-tags {
  font-weight: 400;
}

.about-content {
  margin-inline: var(--page-margin);
  padding-bottom: 96px;
}

.bio-column {
  --bio-text-size: 20pt;
  width: var(--rules-gap);
  max-width: 100%;
  font-size: var(--bio-text-size);
  line-height: 1.5;
}

.bio-column h2 {
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 24px;
}

.bio-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  font-size: 14pt;
}

.bio-details h2 {
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}

.bio-details h2,
.bio-details p {
  margin: 0;
}

.bio-column p {
  margin: 0 0 24px;
}

.bio-column hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 48px 0;
}

.project-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: var(--project-color);
}

.project-hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-hero--16-9 {
  height: auto;
  aspect-ratio: 16 / 9;
}

.project-hero .project-header {
  position: absolute;
  top: 0;
  left: var(--page-margin);
  right: var(--page-margin);
  margin-inline: 0;
}

.project-hero h1 {
  position: absolute;
  left: var(--page-margin);
  bottom: 48px;
  margin: 0;
  font-size: 20pt;
  font-weight: 400;
}

.project-content {
  margin-inline: var(--page-margin);
  padding-top: 64px;
  padding-bottom: 96px;
}

.project-image-space {
  min-height: 60svh;
}

.project-intro {
  width: calc(var(--rules-gap) * 1.21);
  font-size: 26pt;
  margin-inline: auto;
  text-align: center;
  font-weight: 500;
}

.project-intro p:last-child {
  margin-bottom: 0;
}

.project-intro + .project-image-space {
  margin-top: 64px;
}

.project-images {
  --project-image-gap: 32px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--project-image-gap);
  margin: 64px 0 64px;
}

.project-images img {
  display: block;
  width: 100%;
  height: auto;
}

.project-page--spoiler-warning .project-images img:not(:last-child) {
  border: 1px solid #000;
}

.project-page--spoiler-warning .project-images img:last-child {
  width: 70%;
  height: auto;
  align-self: center;
}

.project-images--edge-aligned {
  width: calc(100% + 2 * var(--page-margin));
  margin-inline: calc(-1 * var(--page-margin));
}

.project-images--edge-aligned .project-image--wide {
  width: calc(100% - 2 * var(--page-margin));
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  align-self: center;
}

.project-images--edge-aligned .project-image--small {
  width: calc((100% - 2 * var(--page-margin) - 32px) / 2);
  height: auto;
}

.project-image--left {
  align-self: flex-start;
}

.project-image--right {
  align-self: flex-end;
}

.project-images--edge-aligned .project-image--left {
  margin-left: var(--page-margin);
}

.project-images--edge-aligned .project-image--right {
  margin-right: var(--page-margin);
}

.project-images--edge-aligned .project-image--ladder {
  margin-top: var(--ladder-margin-top, 0px);
}

.project-description {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, calc((var(--rules-gap) - 24px) / 2)) minmax(0, 1fr);
  gap: 24px;
  font-size: 14pt;
  font-weight: 400;
  line-height: 1.5;
}

.project-description p {
  margin: 0;
}

.project-description-copy p + p {
  margin-top: 1lh;
}

.project-description h2 {
  grid-column: 1 / 3;
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}

.project-tags {
  grid-column: 3;
  grid-row: 2;
  margin-left: 72px; /* Adds to the 24px grid gap, making this gutter 96px. */
}

/* Explicit positions prevent body text from filling the title row. */
.project-description > h2 {
  grid-column: 1 / 3;
  grid-row: 1;
}

.project-description > .project-description-copy,
.project-description > p {
  grid-row: 2;
}

.project-description > .project-description-copy:nth-of-type(1),
.project-description > p:nth-of-type(1) {
  grid-column: 1;
}

.project-description > .project-description-copy:nth-of-type(2),
.project-description > p:nth-of-type(2) {
  grid-column: 2;
}

.project-tags h2 {
  display: none;
}

.project-tags .project-collaboration {
  margin-top: 1lh;
}

.work-footer-spacer {
  height: max(0px, calc(100svh - var(--work-gallery-bottom, 100svh) - 32px));
}

.work-footer {
  --wordmark-size: var(--shared-wordmark-size, 36pt);
  --footer-text-size: calc(var(--wordmark-size) / 2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 32px;
  padding: 64px var(--page-margin);
  background: #eee;
}

.work-footer-contact,
.work-footer-navigation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #555;
  font-size: var(--footer-text-size);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.work-footer > .wordmark {
  font-size: var(--footer-text-size);
}

.work-footer-contact {
  justify-self: end;
}

.work-footer-navigation {
  position: relative;
  left: 50%;
  justify-self: start;
}

.work-footer-contact a,
.work-footer-navigation a {
  color: inherit;
  text-decoration: none;
}

.work-footer-contact a:hover,
.work-footer-navigation a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .project-track {
    position: static;
    transform: none;
  }

  .project-stage {
    overflow-y: auto;
  }

  .project-placeholder[data-loop-copy] {
    display: none;
  }
}

/* Preserve room for the longer wordmark on narrower screens. */
@media (max-width: 1600px) {
  :root {
    --page-margin: clamp(24px, 10vw, 250px);
    --rules-gap: min(880px, calc((100vw - 2 * var(--page-margin)) * 0.62));
  }
}

@media (max-width: 600px) {
  :root {
    --header-bottom-space: 32px;
    --rules-gap: calc(100vw - 2 * var(--page-margin));
  }

  .portfolio-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 240px minmax(0, 1fr);
  }

  .portfolio-layout::before,
  .portfolio-layout::after {
    top: var(--mobile-header-height, 240px);
  }

  .work-header {
    position: relative;
    left: auto;
    width: auto;
    margin-inline: var(--page-margin);
  }

  .work-showcase {
    margin-top: 0;
  }

  .work-footer {
    grid-template-columns: 1fr;
  }

  .work-footer-contact,
  .work-footer-navigation {
    justify-self: start;
  }

  .project-description {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-tags {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-left: 0;
  }
}
