/* ================================================================
   FONTS
   ================================================================ */
@font-face {
  font-family: 'Damn';
  src: url('https://static1.squarespace.com/static/67979e7bf6b3e437c1733abe/t/68e9196cf65a8d5ecb849ff1/1760106860943/DAMN.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #fff;
  font-family: 'Damn', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Hide any Squarespace-injected chrome */
header.sqs-header,
.Header,
.sqs-header,
#header,
.site-header,
.site-header-wrapper,
.sqs-block-footer,
.site-footer {
  display: none !important;
}

.sqs-block-code {
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
}

/* ================================================================
   TOP BAR
   Logo centred horizontally; no headline.
   ================================================================ */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 20px 24px;
  position: relative;
  z-index: 20;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.project-logo {
  display: block;
  width: 100px;
  height: auto;
  user-select: none;
}

@media (max-width: 768px) {
  .topbar {
    padding: 20px 16px 16px;
  }

  .project-logo {
    width: 64px;
  }
}

/* ================================================================
   GRID
   ================================================================ */
.page {
  width: 100%;
  min-height: calc(100vh - 120px);
  padding: 0 6px 24px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  grid-auto-flow: dense;
}

.tile {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: #eee;
  padding: 0;
  border: 0;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.02);
}

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

@media (max-width: 768px) {
  .page {
    padding: 0 4px 16px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
}

/* ================================================================
   LIGHTBOX
   Driven by JS via the .is-open class on #lightbox.
   ================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 250ms ease, visibility 0s linear 250ms;
  z-index: 1000;
  padding: 20px;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 250ms ease, visibility 0s linear 0s;
}

.lightbox__img {
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  /* Don't let clicks on the image bubble up to the overlay's
     click-to-close handler */
  pointer-events: auto;
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 32px;
  color: #fff;
  line-height: 1;
  padding: 6px 12px;
  font-family: system-ui, sans-serif;
  cursor: pointer;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  opacity: 0.7;
}

/* Lock background scroll while the lightbox is open */
body.lightbox-open {
  overflow: hidden;
}