@font-face {
  font-family: "Mango Grotesque";
  src: url("./fonts/mango-grotesque-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("./fonts/barlow-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #000;
  --muted: rgba(0, 0, 0, .58);
  --line: rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Barlow", Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
}

button, a { color: inherit; }

a { text-decoration: none; }

button { font: inherit; }

.scroll-progress {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(0, 0, 0, .08);
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}

.brand, .archive-status { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: invert(1);
}

.archive-status {
  display: grid;
  grid-template-columns: auto auto;
  gap: 32px;
  padding-top: 8px;
  letter-spacing: .08em;
}

.hero {
  min-height: 88vh;
  padding: 120px 24px 52px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero > p {
  margin: 0 0 20px;
  color: var(--muted);
  letter-spacing: .12em;
}

.hero h1 {
  margin: 0;
  max-width: 1100px;
  font-family: "Mango Grotesque", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(9rem, 21vw, 23rem);
  font-weight: 700;
  line-height: .68;
  letter-spacing: -.025em;
}

.hero-note {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: .08em;
}

.archive { padding: 0 24px 14vw; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: clamp(18px, 2.2vw, 42px) clamp(12px, 1.4vw, 28px);
}

.gallery-item {
  grid-column: span 4;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(calc(42px + var(--shift, 0px)));
  transition: opacity .8s cubic-bezier(.33, 1, .68, 1), transform .8s cubic-bezier(.33, 1, .68, 1);
}

.gallery-item:nth-child(7n + 1) { grid-column: span 5; }
.gallery-item:nth-child(7n + 2) { grid-column: span 3; margin-top: 10vw; }
.gallery-item:nth-child(7n + 4) { grid-column: span 6; }
.gallery-item:nth-child(7n + 5) { grid-column: span 3; margin-top: 6vw; }
.gallery-item:nth-child(7n + 6) { grid-column: span 3; }

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(var(--shift, 0px));
}

.image-frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eee;
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.002);
  transition: transform .75s cubic-bezier(.33, 1, .68, 1), filter .4s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.045); }

.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 9px;
  border-top: 1px solid var(--ink);
  line-height: 1;
  letter-spacing: .06em;
}

.item-meta span:last-child { color: var(--muted); }

.gallery-item:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }

.gallery-status {
  margin: 72px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: .08em;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 24px 36px;
  border-top: 1px solid var(--line);
  letter-spacing: .08em;
}

dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: #000;
}

dialog::backdrop { background: #000; }

.viewer-bar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  letter-spacing: .08em;
}

.viewer-bar p { margin: 0; }

.viewer-bar button,
.viewer-nav {
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.viewer-stage {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 68px 0 24px;
}

.viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-nav { height: 100%; font-size: 24px; }
.viewer-nav:focus-visible, .viewer-bar button:focus-visible { outline: 1px solid #fff; }

body.viewer-open { overflow: hidden; }

@media (max-width: 767px) {
  .site-header { padding: 12px; }
  .brand span, .archive-status span:first-child { display: none; }
  .brand img { width: 42px; height: 42px; }
  .archive-status { padding-top: 6px; }
  .hero { min-height: 72vh; padding: 100px 12px 36px; }
  .hero h1 { font-size: clamp(6.8rem, 34vw, 12rem); line-height: .7; }
  .hero-note { margin-top: 34px; }
  .archive { padding: 0 12px 28vw; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 10px; }
  .gallery-item,
  .gallery-item:nth-child(n) { grid-column: span 1; margin-top: 0; }
  .gallery-item:nth-child(5n + 2) { margin-top: 18vw; }
  .gallery-item:nth-child(6n + 4) { grid-column: 1 / -1; }
  .item-meta { font-size: 10px; }
  footer { padding: 14px 12px 24px; }
  .viewer-stage { grid-template-columns: 44px minmax(0, 1fr) 44px; padding-top: 56px; }
  .viewer-bar { padding: 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery-item, .gallery-item.is-visible { opacity: 1; transform: none; transition: none; }
  .image-frame img { transition: none; }
}
