@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/css/fonts/sg-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/css/fonts/jbm-latin.woff2') format('woff2');
}

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

:root {
  --bg: oklch(0.992 0.003 240);
  --paper: oklch(0.985 0.004 240);
  --ink: oklch(0.16 0.012 250);
  --muted: oklch(0.5 0.012 250);
  --rule: oklch(0.16 0.012 250);
  --accent: oklch(0.52 0.205 252);
  --accent-soft: oklch(0.95 0.04 252);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--bg);
  border: 2px solid var(--accent);
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s ease;
}

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

.dot {
  color: var(--accent);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 20px 48px;
  border-bottom: 2px solid var(--rule);
  background: var(--bg);
}

.gallery-mark {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.gallery-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.gallery-nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0.72;
}

.gallery-nav-links a:hover {
  color: var(--accent);
  opacity: 1;
}

.gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  min-height: 360px;
  border-bottom: 2px solid var(--rule);
}

.gallery-hero > div,
.gallery-hero > p {
  padding: clamp(28px, 5vw, 56px) 48px;
}

.gallery-hero > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-right: 2px solid var(--rule);
}

.gallery-hero h1 {
  margin: 12px 0 0;
  font-size: clamp(84px, 15vw, 164px);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.05em;
}

.gallery-hero > p {
  display: flex;
  align-items: flex-end;
  margin: 0;
  background: var(--accent);
  color: white;
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.gallery-toolbar {
  display: grid;
  grid-template-columns: 260px 1fr;
  border-bottom: 2px solid var(--rule);
}

.gallery-toolbar > div {
  padding: 24px 48px;
}

.gallery-toolbar > div:first-child {
  border-right: 2px solid var(--rule);
}

.gallery-toolbar h2 {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.gallery-filters button {
  min-height: 44px;
  border: 2px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-filters button:hover,
.gallery-filters button.is-active {
  background: var(--ink);
  color: white;
}

.gallery-status {
  min-height: 70px;
  padding: 24px 48px;
  border-bottom: 2px solid var(--rule);
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-status[hidden] {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  border-bottom: 2px solid var(--rule);
}

.gallery-card {
  position: relative;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.gallery-card:hover .gallery-card-image img,
.gallery-card:focus-visible .gallery-card-image img {
  transform: scale(1.035);
}

.gallery-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: oklch(0.94 0.008 250);
}

.gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.gallery-card-meta {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border-top: 1px solid var(--rule);
}

.gallery-card-category {
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gallery-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  align-items: center;
  background: oklch(0.08 0.012 250 / 0.94);
  color: white;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox figure {
  max-width: min(1100px, 100%);
  max-height: min(86vh, 900px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.gallery-lightbox img {
  max-height: 76vh;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

.gallery-lightbox figcaption {
  max-width: 70ch;
  margin: 0 auto;
  color: rgb(255 255 255 / 0.82);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  border: 2px solid rgb(255 255 255 / 0.42);
  background: transparent;
  color: white;
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  min-height: 48px;
  text-transform: uppercase;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: white;
  color: var(--ink);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 0 16px;
}

.lightbox-nav {
  width: 64px;
  height: 64px;
  justify-self: center;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .gallery-nav {
    min-height: 64px;
    padding: 16px 20px;
  }

  .gallery-nav-links {
    gap: 18px;
  }

  .gallery-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .gallery-hero > div,
  .gallery-hero > p {
    padding: 28px 20px;
  }

  .gallery-hero > div {
    min-height: 230px;
    border-right: 0;
    border-bottom: 2px solid var(--rule);
  }

  .gallery-hero h1 {
    font-size: clamp(74px, 24vw, 110px);
  }

  .gallery-toolbar {
    grid-template-columns: 1fr;
  }

  .gallery-toolbar > div {
    padding: 18px 20px;
  }

  .gallery-toolbar > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .gallery-status {
    padding: 20px;
  }

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

  .gallery-card-meta {
    min-height: 82px;
    padding: 12px;
  }

  .gallery-card-title {
    font-size: 14px;
  }

  .gallery-lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 12px;
    padding: 72px 16px 18px;
  }

  .gallery-lightbox figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .gallery-lightbox img {
    max-height: 62vh;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
  }

  .lightbox-nav {
    grid-row: 2;
    width: 100%;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
