/**
 * LABIT theme — main stylesheet
 */

:root {
  --color-bg: #ffffff;
  --color-fg: #000000;
  --color-muted: #9a9a9a;
  --font-serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-script: "Caveat", "Segoe Print", cursive;
  --font-menu: Courier, "Courier New", monospace;
  --header-h: 72px;
  --nav-w: min(340px, 42vw);
  --grid-gap: 8px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* -------------------------------------------------------------------------- */
/* Header
/* -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--color-bg);
  height: var(--header-h);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header__menu-btn,
.site-header__grid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.site-header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 14px;
}

.site-header__hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--color-fg);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}

.is-nav-open .site-header__hamburger span:nth-child(1) {
  transform: translateY(6.25px) rotate(45deg);
}

.is-nav-open .site-header__hamburger span:nth-child(2) {
  opacity: 0;
}

.is-nav-open .site-header__hamburger span:nth-child(3) {
  transform: translateY(-6.25px) rotate(-45deg);
}

.site-header__logo {
  justify-self: center;
  display: flex;
  align-items: center;
}

.site-header__logo img {
  width: clamp(96px, 14vw, 140px);
  height: auto;
}

.site-header__grid-btn {
  justify-self: end;
}

.site-header__grid-icon {
  width: 18px;
  height: 18px;
  fill: var(--color-fg);
  transition: transform 0.35s var(--ease-out);
}

.site-header__grid-btn:hover .site-header__grid-icon {
  transform: scale(1.08);
}

.site-header__grid-img {
  width: 20px;
  height: 20px;
  display: block;
  transition: transform 0.35s var(--ease-out);
}

.site-header__grid-btn:hover .site-header__grid-img {
  transform: scale(1.08);
}

/* Dark header (View All) */
.site-header--dark {
  background: #000;
}

.site-header--dark .site-header__hamburger span {
  background: #fff;
}

.labit-view-all {
  background: #000;
}

.labit-view-all .site-nav {
  background: #fff;
}

/* -------------------------------------------------------------------------- */
/* View All mosaic
/* -------------------------------------------------------------------------- */

.view-all {
  background: #000;
  padding: 0 0 80px;
  min-height: calc(100vh - var(--header-h));
}

.view-all__mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
}

.view-all__item {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #111;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.view-all__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease-out), opacity 0.35s ease;
  pointer-events: none;
}

.view-all__item:hover img {
  transform: scale(1.04);
  opacity: 0.88;
}

@media (max-width: 1100px) {
  .view-all__mosaic {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .view-all__mosaic {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 400px) {
  .view-all__mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -------------------------------------------------------------------------- */
/* Lightbox
/* -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.lightbox[hidden] {
  display: flex !important;
}

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

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 1100px);
  max-height: calc(100vh - var(--header-h) - 48px);
  margin-top: var(--header-h);
  padding: 0 48px;
}

.lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: calc(100vh - var(--header-h) - 64px);
  line-height: 0;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - var(--header-h) - 64px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #111;
}

.lightbox__close {
  position: absolute;
  top: -8px;
  right: 8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  font-weight: 200;
  line-height: 1;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.lightbox__close:hover {
  opacity: 0.55;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  font-weight: 200;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lightbox__nav:hover {
  opacity: 1;
}

.lightbox__nav--prev {
  left: 0;
}

.lightbox__nav--next {
  right: 0;
}

body.is-lightbox-open {
  overflow: hidden;
}

body.is-lightbox-open .site-header {
  z-index: 450;
}

@media (max-width: 640px) {
  .lightbox__stage {
    padding: 0 36px;
    width: 96vw;
  }

  .lightbox__close {
    top: -36px;
    right: 0;
  }

  .lightbox__nav {
    font-size: 40px;
  }
}

/* -------------------------------------------------------------------------- */
/* Nav — left panel (burger menu)
/* -------------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  width: var(--nav-w);
  background: var(--color-bg);
  display: block;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out), visibility 0.4s;
}

.site-nav[hidden] {
  display: block !important;
}

.site-nav.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.site-nav__inner {
  padding: calc(var(--header-h) + 36px) 28px 40px 28px;
}

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

.site-nav__list li + li {
  margin-top: 22px;
}

.site-nav__list a {
  font-family: var(--font-menu);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--color-fg);
  transition: opacity 0.25s ease;
}

.site-nav__list a:hover {
  opacity: 0.45;
}

/* Dim remaining page when menu is open */
.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.4s;
}

.site-nav-backdrop.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Works grid
/* -------------------------------------------------------------------------- */

.works {
  padding: 0 10px 0;
}

.works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  max-width: 1440px;
  margin: 0 auto;
}

.works__item {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f2f2f2;
  aspect-ratio: 3 / 2;
  opacity: 0;
  transform: translateY(18px);
  animation: works-in 0.7s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 0.045s);
}

.works__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out), filter 0.45s ease;
}

.works__item:hover img {
  transform: scale(1.04);
  filter: brightness(0.82);
}

.works__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.works__item:hover .works__label {
  opacity: 1;
  transform: translateY(0);
}

@keyframes works-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .works__item {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .works__item img,
  .works__label,
  .site-header__grid-icon {
    transition: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Manifesto (image)
/* -------------------------------------------------------------------------- */

.manifesto {
  padding: 0;
  text-align: center;
  width: 100%;
}

.manifesto__inner {
  display: block;
  max-width: none;
  width: 100%;
}

.manifesto__img {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0;
  object-fit: cover;
}

/* -------------------------------------------------------------------------- */
/* Category nav
/* -------------------------------------------------------------------------- */

.cat-nav {
  padding: 8px 20px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cat-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: min-content;
  white-space: nowrap;
}

.cat-nav__item {
  display: inline-flex;
  align-items: center;
}

.cat-nav__sep {
  margin: 0 0.45em;
  color: #bbb;
  font-size: 11px;
}

.cat-nav__link {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #999;
  transition: color 0.2s ease;
}

a.cat-nav__link:hover,
.cat-nav__link.is-active {
  color: var(--color-fg);
}

.works__empty {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
}

/* -------------------------------------------------------------------------- */
/* Work showcase (project detail)
/* -------------------------------------------------------------------------- */

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

.work-showcase {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px 48px;
}

.work-showcase__gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.work-showcase__figure {
  margin: 0;
  background: #f2f2f2;
  overflow: hidden;
}

.work-showcase__figure--full {
  grid-column: 1 / -1;
}

.work-showcase__figure--half {
  grid-column: span 1;
}

.work-showcase__figure img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.works-divider {
  border: 0;
  border-top: 1px solid #e5e5e5;
  margin: 24px auto 40px;
  max-width: 1100px;
  width: calc(100% - 20px);
}

.works--below {
  padding-bottom: 0;
}

.works__item.is-current {
  outline: 1px solid #000;
  outline-offset: -1px;
}

@media (max-width: 640px) {
  .cat-nav {
    padding: 4px 14px 16px;
    justify-content: flex-start;
  }

  .cat-nav__list {
    justify-content: flex-start;
  }

  .work-showcase {
    padding: 0 6px 32px;
  }

  .work-showcase__gallery {
    gap: 6px;
  }
}

/* -------------------------------------------------------------------------- */
/* About
/* -------------------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  align-items: start;
}

.about__media img {
  width: 100%;
  height: auto;
}

.about__title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.about__text {
  font-size: 15px;
  line-height: 1.9;
  color: #222;
}

.about__text p {
  margin: 0 0 1.2em;
}

/* -------------------------------------------------------------------------- */
/* Generic page
/* -------------------------------------------------------------------------- */

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}

.page-content__title {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-content__body {
  line-height: 1.9;
}

.page-content__empty {
  color: var(--color-muted);
}

.page-content--404 {
  text-align: center;
  padding-top: 120px;
}

/* -------------------------------------------------------------------------- */
/* Footer
/* -------------------------------------------------------------------------- */

.site-footer {
  padding: 32px 24px 48px;
  border-top: 1px solid #eee;
}

.site-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  text-align: center;
}

.site-footer__copy {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--color-muted);
}

/* -------------------------------------------------------------------------- */
/* Responsive
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root {
    --header-h: 64px;
    --grid-gap: 8px;
  }

  .works {
    padding: 0 8px;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  :root {
    --grid-gap: 6px;
    --nav-w: min(280px, 78vw);
  }

  .works__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .works__label {
    font-size: 10px;
    padding: 10px 8px;
  }

  .site-header__inner {
    padding: 0 14px;
  }
}
