:root {
  --ink: #333333;
  --paper: #ffffff;
  --soft: #d9d9d9;
  --max: 1600px;
  --side: clamp(24px, 5vw, 150px);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

img {
  display: block;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  width: min(var(--max), calc(100% - (var(--side) * 2)));
  min-height: 80px;
  margin: 0 auto;
  background: var(--paper);
}

.brand {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  transition: transform 180ms ease;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand:hover,
.work-card-button:hover,
.thumb-button:hover,
.contact-button:hover {
  transform: translateY(-2px);
}

.desktop-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.nav-pill {
  min-width: 72px;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  line-height: 1;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.nav-pill.is-active,
.nav-pill:hover {
  background: var(--ink);
  color: var(--paper);
}

.contact-button,
.mini-envelope,
.filter-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 28px;
  justify-self: end;
  transition: transform 180ms ease;
}

.contact-button img,
.mini-envelope img,
.filter-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.filter-button {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  padding: 0;
  line-height: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.filter-button img {
  max-width: 24px;
  max-height: 24px;
}

.filter-button:hover,
.filter-button[aria-expanded="true"] {
  transform: translateY(-2px);
}

.filter-button:hover {
  opacity: 0.78;
}

.mobile-menu-button,
.mobile-nav {
  display: none;
}

.site-main {
  width: min(var(--max), calc(100% - (var(--side) * 2)));
  flex: 1 0 auto;
  margin: 0 auto;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  justify-content: start;
  gap: 48px 30px;
  padding: 30px 0 150px;
}

.folio-controls {
  display: none;
  grid-template-columns: 160px 160px 160px minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 0 0 26px;
}

.folio-controls.is-open {
  display: grid;
}

.control-field {
  display: grid;
  gap: 8px;
}

.control-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-header p {
  margin: 0;
  font-weight: 700;
}

.control-field label {
  font-size: 0.75rem;
}

.control-field select,
.control-field input,
.control-reset,
.control-close {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}

.control-reset {
  min-width: 84px;
  cursor: pointer;
}

.control-close {
  width: auto;
  min-width: 76px;
  cursor: pointer;
}

.control-reset:hover,
.control-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.work-card {
  width: 100%;
}

.empty-state {
  margin: 0;
  font-size: 0.875rem;
}

.work-card-button {
  display: block;
  width: 100%;
  text-align: left;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.work-card-button:hover {
  opacity: 0.78;
}

.work-card img {
  aspect-ratio: 300 / 170;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.work-title,
.work-detail {
  display: block;
}

.work-title {
  margin-top: 18px;
  font-weight: 700;
}

.work-detail {
  margin-top: 8px;
  font-size: 0.75rem;
}

.project-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  padding: 30px 0 80px;
}

.thumb-rail,
.project-description-column {
  position: sticky;
  top: 150px;
}

.thumb-rail {
  display: grid;
  gap: 18px;
}

.thumb-button {
  display: block;
  width: 124px;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  opacity: 0.45;
  line-height: 0;
  transition:
    opacity 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.thumb-button.is-active {
  box-shadow: 0 0 0 2px var(--ink);
  opacity: 1;
}

.thumb-button img {
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--soft);
}

.breadcrumb {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.75rem;
}

.desktop-image-stack {
  display: grid;
  gap: 28px;
}

.project-figure,
.carousel-slide {
  margin: 0;
}

.project-figure img {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

figcaption {
  padding: 18px 8px 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.project-copy {
  font-size: 0.875rem;
}

.project-copy-toggle {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font-weight: 700;
  pointer-events: none;
}

.chevron {
  display: none;
}

.project-detail-label {
  margin: 10px 0 12px;
}

.project-description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

.mobile-carousel {
  display: none;
}

.contact-view {
  display: grid;
  place-items: center;
  min-height: 58vh;
}

.contact-panel {
  display: grid;
  gap: 20px;
  width: min(680px, 100%);
  text-align: center;
}

.contact-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  font-weight: 700;
  line-height: 0.95;
}

.contact-kicker,
.contact-email,
.contact-links {
  font-size: 0.875rem;
}

.contact-kicker {
  margin: 0;
}

.contact-email {
  justify-self: center;
  min-width: 220px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 700;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.contact-email:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-links a:hover {
  text-decoration: underline;
}

.site-footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 160px 160px 1fr;
  gap: 32px;
  align-items: end;
  width: min(var(--max), calc(100% - (var(--side) * 2)));
  margin: 0 auto;
  padding: 48px 0 42px;
}

.footer-links {
  display: grid;
  gap: 14px;
  font-size: 0.75rem;
}

.social-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}

.social-links > a {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.social-links > a:hover {
  opacity: 0.78;
  transform: translateY(-2px);
}

.social-links img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-envelope {
  width: 24px;
  height: 19px;
}

@media (max-width: 1180px) {
  .site-header,
  .site-main,
  .site-footer {
    width: min(100% - 48px, var(--max));
  }

  .project-layout {
    grid-template-columns: 100px minmax(0, 1fr) 260px;
    gap: 22px;
  }

  .thumb-button {
    width: 88px;
  }
}

@media (max-width: 760px) {
  :root {
    --mobile-gutter: 20px;
  }

  body {
    font-size: 1.125rem;
  }

  .site-header {
    grid-template-columns: 96px 1fr 76px;
    width: 100%;
    min-height: 60px;
    padding: 4px var(--mobile-gutter);
  }

  .brand {
    width: 40px;
    height: 40px;
  }

  .brand img {
    max-width: 40px;
    max-height: 40px;
  }

  .contact-button img,
  .social-links img {
    max-width: 32px;
    max-height: 32px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
    justify-self: center;
    place-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .mobile-menu-button span {
    display: block;
    width: 32px;
    height: 4px;
    border-radius: 999px;
    background: var(--ink);
  }

  .filter-button {
    display: none;
  }

  .mobile-nav .filter-button {
    display: grid;
    place-items: center;
    justify-self: center;
    align-self: stretch;
    width: 40px;
    height: 100%;
    min-height: 40px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--paper);
  }

  .mobile-nav .filter-button[aria-expanded="true"] {
    background: var(--ink);
    opacity: 1;
    transform: none;
  }

  .mobile-nav .filter-button[aria-expanded="true"] img {
    filter: invert(1);
  }

  .mobile-nav .filter-button:hover {
    opacity: 1;
    transform: none;
  }

  .mobile-nav .filter-button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  .contact-button {
    width: 40px;
    height: 40px;
  }

  .mobile-nav {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    display: none;
    width: 100vw;
    gap: 12px;
    padding: 24px var(--mobile-gutter) 28px;
    background: var(--paper);
    transform: translateX(-50%);
  }

  .site-header.is-menu-open .mobile-nav {
    display: grid;
  }

  .mobile-nav-row {
    display: grid;
    grid-template-columns: 1fr 40px;
    gap: 12px;
    align-items: stretch;
  }

  .mobile-nav-row .mobile-filter-button {
    grid-column: 2;
    grid-row: 1;
  }

  .mobile-nav .nav-pill {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--paper);
    color: var(--ink);
    text-align: left;
    font-size: 1rem;
  }

  .mobile-nav .nav-pill.is-active,
  .mobile-nav .nav-pill:hover {
    background: var(--ink);
    color: var(--paper);
  }

  .site-main {
    width: 100%;
    min-height: auto;
  }

  .home-view {
    padding: 0 var(--mobile-gutter);
  }

  .work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 18px 0 36px;
  }

  .folio-controls {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 0 24px;
  }

  .control-field label {
    font-size: 0.75rem;
  }

  .control-field select,
  .control-field input,
  .control-reset,
  .control-close {
    font-size: 1rem;
  }

  .work-card {
    width: 100%;
  }

  .work-card img {
    aspect-ratio: 1.35;
  }

  .work-title {
    margin-top: 12px;
    font-size: 1rem;
  }

  .work-detail {
    margin-top: 6px;
    font-size: 0.75rem;
  }

  .project-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0 0 28px;
  }

  .thumb-rail {
    position: sticky;
    top: 0px;
    z-index: 15;
    order: 1;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    width: 100%;
    padding: 12px var(--mobile-gutter);
    background: var(--paper);
    scrollbar-width: none;
  }

  .thumb-rail::-webkit-scrollbar,
  .mobile-carousel::-webkit-scrollbar {
    display: none;
  }

  .thumb-button {
    flex: 0 0 60px;
    width: 60px;
    border-radius: 7px;
  }

  .thumb-button.is-active {
    box-shadow: 0 0 0 2px var(--ink);
  }

  .project-media-column {
    order: 3;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }

  .breadcrumb,
  .desktop-image-stack {
    display: none;
  }

  .project-description-column {
    position: static;
    order: 2;
    padding: 0px var(--mobile-gutter) 0px;
  }

  .project-copy {
    font-size: 1.125rem;
  }

  .project-copy-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    pointer-events: auto;
    font-size: 1rem;
  }

  .chevron {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 180ms ease;
  }

  .project-copy.is-open .chevron {
    transform: rotate(180deg);
  }

  .project-copy-content {
    display: none;
    padding-top: 12px;
  }

  .project-copy.is-open .project-copy-content {
    display: block;
  }

  .project-detail-label {
    margin: 0 0 16px;
  }

  .project-description {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .mobile-carousel {
    order: 4;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    width: 100%;
    max-width: 100vw;
    padding: 18px var(--mobile-gutter) 0;
    scroll-padding-inline: var(--mobile-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .carousel-slide {
    flex: 0 0 calc(100vw - (var(--mobile-gutter) * 3));
    max-width: calc(100vw - (var(--mobile-gutter) * 3));
    scroll-margin-inline: var(--mobile-gutter);
    scroll-snap-align: start;
  }

  .carousel-slide img {
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    object-fit: cover;
    background: var(--soft);
  }

  figcaption {
    padding: 20px 10px 0;
    font-size: 1rem;
  }

  .contact-view {
    min-height: 55vh;
    padding: 0 var(--mobile-gutter);
  }

  .contact-panel {
    gap: 18px;
    text-align: left;
  }

  .contact-panel h1 {
    font-size: 2.25rem;
    line-height: 1;
  }

  .contact-email {
    justify-self: stretch;
    text-align: center;
  }

  .contact-links {
    justify-content: flex-start;
    gap: 14px;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    justify-items: start;
    width: 100%;
    gap: 16px 14px;
    padding: 34px var(--mobile-gutter) 28px;
    text-align: left;
  }

  .footer-links {
    gap: 12px;
    font-size: 0.8rem;
  }

  .social-links {
    grid-column: 1 / -1;
    justify-content: center;
    justify-self: center;
    gap: 18px;
  }

  .social-links > a {
    width: 40px;
    height: 40px;
  }

  .mini-envelope {
    width: 40px;
    height: 40px;
  }
}
