
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Mono:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&display=swap");

:root {
  --background: #171717;
  --surface: #202020;
  --text: #e8e6df;
  --muted: #92918a;
  --border: #393939;
  --accent: #c7c4b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html {
  background: var(--background);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* HEADER */

.site-header {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
  padding: 38px 0 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.header-identity {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.header-label,
.page-index,
.footer-label {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.header-identity h1 {
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 400;
  line-height: 0.95;
}

.header-identity h1 span {
  color: var(--muted);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.home-link::before {
  content: "←";
  color: var(--muted);
  transition: transform 180ms ease;
}

.home-link:hover {
  color: var(--text);
  border-color: #77766e;
  background: var(--surface);
}

.home-link:hover::before {
  transform: translateX(-3px);
}

/* PAGE HEADING */

main {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
}

.page-heading {
  padding: 48px 0 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-index {
  margin-bottom: 9px;
}

.page-heading h2 {
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 400;
  line-height: 0.95;
}

.page-heading h2 em {
  color: var(--muted);
  font-weight: 400;
}

.page-description {
  max-width: 330px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  text-align: right;
}

/* CATEGORY NAVIGATION */

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
}

.category-nav a {
  padding: 8px 11px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 180ms ease;
}

.category-nav a:hover,
.category-nav a.active {
  border-color: #77766e;
  color: var(--text);
  background: var(--surface);
}

/* MASONRY GALLERY */

.gallery {
  position: relative;
  width: 100%;
  padding: 36px 0 75px;
}

.gallery img {
  position: absolute;
  display: block;
  height: auto;
  max-width: none;
  object-fit: cover;
  cursor: zoom-in;
  background: #202020;
  border: 1px solid #303030;
  opacity: 0;
  transition:
    opacity 250ms ease,
    filter 250ms ease;
}

.gallery img.is-positioned {
  opacity: 1;
}

.gallery img:hover {
  filter: brightness(0.82);
}

.gallery img:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 76px;
  background: rgba(8, 8, 8, 0.96);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border);
}

.lightbox-button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.lightbox-button:hover {
  background: #303030;
  border-color: #77766e;
}

.lightbox-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.lightbox-close {
  top: 20px;
  right: 22px;
  font-size: 22px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
}

body.lightbox-open {
  overflow: hidden;
}

/* FOOTER */

.site-footer {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
  padding: 17px 0 25px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
}

.footer-label {
  font-size: 8px;
}

/* RESPONSIVE */

@media (max-width: 850px) {
  .gallery {
    padding-top: 36px;
  }
}

@media (max-width: 600px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 36px);
  }

  .site-header {
    padding: 26px 0 22px;
  }

  .header-identity h1 {
    font-size: 36px;
  }

  .home-link {
    padding: 8px 9px;
    font-size: 9px;
  }

  .page-heading {
    padding: 36px 0 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-description {
    max-width: 100%;
    text-align: left;
  }

  .gallery {
    padding-top: 36px;
    padding-bottom: 55px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }

  .lightbox {
    padding: 64px 14px;
  }

  .lightbox-button {
    width: 36px;
    height: 36px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-counter {
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
