:root {
  --paper: #f3f1ec;
  --ink: #171716;
  --muted: #706e69;
  --hairline: rgba(23, 23, 22, 0.2);
  --sidebar-width: clamp(15rem, 19vw, 19rem);
  --gutter: clamp(1.25rem, 3vw, 3.75rem);
  --column-gap: clamp(0.8rem, 1.45vw, 1.55rem);
  --row-gap: clamp(2.5rem, 5.5vw, 6.5rem);
  --quick: 240ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.85rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(1.25rem, 2.5vw, 2.5rem) 2rem 1.5rem clamp(1.25rem, 3vw, 3.5rem);
  background: var(--paper);
}

.home-link,
.nav-link,
.project-open,
.close-project,
.back-link,
.download-link {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.home-link {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}

.brand-wordmark {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.05rem, 1.15vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 0.88;
}

.brand-wordmark span {
  display: block;
}

.role {
  display: block;
  max-width: 13.25rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.035em;
}

.navigation {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3.4rem;
  padding-block: 2rem;
}

.filter-group,
.view-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.nav-label,
.copyright {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.copyright {
  margin: 0;
  font-size: 0.66rem;
}

.nav-link {
  position: relative;
  padding: 0.22rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  text-underline-offset: 0.25em;
  transition: color 160ms ease, opacity 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
}

.nav-link.is-active {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: clamp(1.5rem, 3vw, 3.5rem) var(--gutter) clamp(5rem, 10vw, 10rem);
}

.mobile-status {
  display: none;
}

.portfolio-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--column-gap);
  row-gap: var(--row-gap);
  align-items: start;
  opacity: 1;
  transition: opacity 120ms ease;
}

.portfolio-grid.is-updating {
  opacity: 0.7;
}

.portfolio-grid[hidden],
.project-card[hidden],
.information-view[hidden] {
  display: none;
}

.project-card {
  min-width: 0;
  margin: 0;
}

.project-open {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}

.project-image-frame {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e5e7e7;
}

.project-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: opacity var(--quick), transform 360ms ease;
}

.project-open:hover img,
.project-open:focus-visible img {
  opacity: 0.94;
  transform: scale(1.008);
}

.project-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.3;
}

.project-title {
  font-family: "Outfit", sans-serif;
  font-weight: 500;
}

.project-discipline {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.layout-small { grid-column: span 3; }
.layout-standard { grid-column: span 4; }
.layout-landscape { grid-column: span 5; }
.layout-wide { grid-column: span 7; }
.layout-portrait { grid-column: span 4; }
.layout-feature { grid-column: span 8; }

.project-detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--column-gap);
  row-gap: clamp(1.5rem, 3vw, 3rem);
  min-width: 0;
  padding: clamp(1rem, 2vw, 2rem) 0 clamp(3rem, 7vw, 7rem);
  border-top: 1px solid var(--hairline);
  animation: detail-reveal 220ms ease both;
}

@keyframes detail-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-head { grid-column: 1 / span 4; }
.detail-copy {
  position: sticky;
  top: 2.5rem;
}

.detail-kicker,
.info-kicker,
.detail-facts dt,
.cv-label {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.detail-title {
  max-width: 10ch;
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(2.5rem, 5vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.detail-description {
  max-width: 28rem;
  margin: 1.5rem 0 2.1rem;
  color: #3e3d39;
  font-size: 1rem;
  line-height: 1.55;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem var(--column-gap);
  max-width: 28rem;
  margin: 0;
}

.detail-facts div {
  padding-top: 0.7rem;
  border-top: 1px solid var(--hairline);
}

.detail-facts dt { margin-bottom: 0.2rem; }
.detail-facts dd {
  margin: 0;
  color: #3e3d39;
  font-size: 0.84rem;
}

.close-project {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.close-project::before {
  content: "×";
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}

.detail-gallery {
  grid-column: 6 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--column-gap);
  min-width: 0;
}

.detail-gallery figure { margin: 0; }
.gallery-image-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.detail-gallery figure:first-child { grid-column: 1 / -1; }
.detail-gallery figure:nth-child(2) { grid-column: 1 / span 3; }
.detail-gallery figure:nth-child(3) {
  grid-column: 4 / -1;
  align-self: end;
}
.detail-gallery figure:nth-child(4) {
  grid-column: 2 / -1;
  margin-top: clamp(1.5rem, 4vw, 4rem);
}

.detail-gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.detail-gallery figure:nth-child(2) img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.preserve-artwork-detail .detail-gallery figure:nth-child(2) img {
  aspect-ratio: auto;
  object-fit: contain;
}

.information-view { min-height: calc(100vh - 7rem); }
.info-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--column-gap);
  animation: detail-reveal 220ms ease both;
}

.info-header { grid-column: 1 / span 4; }
.info-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(4rem, 9vw, 10rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.8;
}

.info-content {
  grid-column: 6 / span 6;
  padding-top: clamp(8rem, 18vw, 18rem);
}

.info-name {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-role {
  margin: 0 0 2.5rem;
  color: var(--muted);
}

.info-lede {
  max-width: 42rem;
  margin: 0 0 clamp(3rem, 7vw, 6rem);
  font-size: clamp(1.55rem, 3vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.info-columns,
.cv-entry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--column-gap);
  padding-block: 1.35rem;
  border-top: 1px solid var(--hairline);
}

.info-columns h2,
.cv-entry h2 {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.info-columns p,
.cv-entry p {
  margin: 0;
  color: #3e3d39;
}

.info-columns p + p {
  margin-top: 1.25rem;
}

.compact-list {
  columns: 2;
  gap: var(--column-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  break-inside: avoid;
  margin-bottom: 0.25rem;
}

.back-link,
.download-link,
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  margin-top: 2.5rem;
  padding: 0 0 0.2rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.download-link {
  margin-top: 3rem;
}

.download-link[aria-disabled="true"] { cursor: not-allowed; }

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  padding: 1.05rem 0;
  border-top: 1px solid var(--hairline);
}

.contact-list span:first-child {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-list a {
  width: fit-content;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 2.5vw, 2.5rem);
  background: rgba(9, 9, 9, 0.94);
  color: #f4f3ef;
  animation: lightbox-reveal 160ms ease both;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lightbox-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-stage {
  display: grid;
  grid-template-columns: minmax(2.75rem, 5vw) minmax(0, 1fr) minmax(2.75rem, 5vw);
  align-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.lightbox-close {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 2;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox-nav {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  font-size: 1.25rem;
  opacity: 0.7;
  transition: opacity 160ms ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  opacity: 1;
}

.lightbox-nav:disabled {
  cursor: default;
  opacity: 0.2;
}

.lightbox-previous { grid-column: 1; justify-self: start; }
.lightbox-next { grid-column: 3; justify-self: end; }

.lightbox-figure {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.lightbox-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
}

.lightbox-figure figcaption {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  color: rgba(244, 243, 239, 0.68);
  font-size: 0.74rem;
  letter-spacing: 0.025em;
  text-align: center;
}

.is-loading .lightbox-figure::before {
  content: "Loading image…";
  position: absolute;
  color: rgba(244, 243, 239, 0.68);
  font-size: 0.74rem;
}

.is-loading .lightbox-figure img {
  opacity: 0;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.gallery-image-open:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.project-open:focus-visible,
.nav-link:focus-visible,
.home-link:focus-visible,
.close-project:focus-visible,
.back-link:focus-visible,
.download-link:focus-visible,
.inline-link:focus-visible,
.contact-list a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  :root { --sidebar-width: 14.25rem; }
  .portfolio-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .layout-small { grid-column: span 2; }
  .layout-standard { grid-column: span 3; }
  .layout-landscape { grid-column: span 4; }
  .layout-wide { grid-column: span 5; }
  .layout-portrait { grid-column: span 3; }
  .layout-feature { grid-column: span 6; }
  .project-detail { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .detail-head { grid-column: 1 / span 3; }
  .detail-gallery { grid-column: 4 / -1; }
  .info-header { grid-column: 1 / span 4; }
  .info-content { grid-column: 5 / -1; }
}

@media (max-width: 760px) {
  :root {
    --column-gap: 0.7rem;
    --row-gap: 2.75rem;
  }

  .sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 1rem 1.25rem 1.15rem;
    border-bottom: 1px solid var(--hairline);
  }

  .brand-wordmark { font-size: 1.05rem; }
  .role {
    max-width: none;
    margin-top: 0.4rem;
    font-size: 0.69rem;
  }

  .navigation {
    display: block;
    padding: 1.3rem 0 0;
  }

  .filter-group,
  .view-group {
    flex-direction: row;
    gap: 0.2rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-group::-webkit-scrollbar,
  .view-group::-webkit-scrollbar { display: none; }
  .view-group { margin-top: 0.65rem; }
  .nav-label,
  .copyright { display: none; }
  .nav-link {
    flex: 0 0 auto;
    padding-block: 0.2rem;
    font-size: 0.8rem;
  }

  .main {
    margin-left: 0;
    padding: 0.85rem 1.25rem 5rem;
  }

  .mobile-status {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0 1rem;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .portfolio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .layout-small,
  .layout-standard,
  .layout-portrait { grid-column: span 2; }
  .layout-landscape { grid-column: span 3; }
  .layout-wide,
  .layout-feature { grid-column: 1 / -1; }
  .project-caption { display: block; }
  .project-discipline {
    display: block;
    margin-top: 0.15rem;
    text-align: left;
  }

  .project-detail { display: block; }
  .detail-copy {
    position: static;
    margin-bottom: 2.5rem;
  }
  .detail-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-gallery figure:first-child,
  .detail-gallery figure:nth-child(4) { grid-column: 1 / -1; }
  .detail-gallery figure:nth-child(2),
  .detail-gallery figure:nth-child(3) { grid-column: span 1; }
  .detail-gallery figure:nth-child(4) { margin-top: 1rem; }
  .information-view { min-height: 0; }
  .info-layout { display: block; }
  .info-title {
    padding-top: 1.5rem;
    font-size: clamp(4rem, 22vw, 7rem);
  }
  .info-content { padding-top: 5rem; }
  .info-lede { font-size: clamp(1.8rem, 8vw, 3.2rem); }
  .info-columns,
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
}

@media (max-width: 460px) {
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { grid-column: 1 / -1; }
  .project-card.layout-small:nth-of-type(5n + 2),
  .project-card.layout-small:nth-of-type(5n + 3) { grid-column: span 1; }
  .project-detail { grid-column: 1 / -1; }
  .detail-facts { grid-template-columns: 1fr; }
  .compact-list { columns: 1; }
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .lightbox {
    padding: max(0.75rem, env(safe-area-inset-top)) 0.5rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .lightbox-stage {
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  }

  .lightbox-figure img {
    max-height: calc(100dvh - 7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
