@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,300..800;1,300..800&display=swap");

:root {
  --ink: #111;
  --paper: #fff;
  --red: #f02d21;
  --edge: clamp(14px, 3.5vw, 48px);
  --gap: clamp(7px, .8vw, 12px);
  font-family: "Inter Tight", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  font-weight: 350;
  letter-spacing: -.045em;
}

button,
a { color: inherit; }

.archive-header {
  position: fixed;
  z-index: 10;
  top: 17px;
  left: var(--edge);
  right: var(--edge);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  font-size: .9rem;
  line-height: .95;
  pointer-events: none;
}

.archive-header > * { pointer-events: auto; }

.archive-brand {
  text-decoration: none;
  white-space: nowrap;
}

.archive-brand em { font-style: italic; }

.archive-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .91;
  text-align: right;
  text-transform: uppercase;
}

.archive-title::before {
  content: "";
  width: 22px;
  border-top: 2px dashed var(--red);
}

.archive-gallery {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--paper);
}

.archive-strip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.archive-strip.is-dragging { cursor: grabbing; }

.archive-strip:focus-visible {
  outline: 2px dashed var(--red);
  outline-offset: -7px;
}

.archive-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap);
  width: max-content;
  height: 100%;
  padding: 66px var(--edge) 46px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.archive-lane {
  display: flex;
  flex: 1 1 0;
  gap: var(--gap);
  width: max-content;
  min-width: 100vw;
  min-height: 0;
}

.archive-cell {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: var(--ratio, 4 / 5);
  margin: 0;
  overflow: hidden;
  background: #eee;
}

.archive-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.archive-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--position, 50% 50%);
  transform: scale(var(--scale, 1));
  filter: var(--filter, none);
  pointer-events: none;
  transition: transform .35s ease;
}

.archive-card:hover img,
.archive-card:focus-visible img {
  transform: scale(calc(var(--scale, 1) * 1.025));
}

.archive-card:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: -5px;
}

.archive-cell figcaption {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  z-index: 2;
  color: #fff;
  font-size: .68rem;
  font-weight: 350;
  letter-spacing: -.04em;
  line-height: .95;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .75);
  opacity: .86;
  pointer-events: none;
}

.gerontophilia-page .archive-cell figcaption {
  display: none;
}

.archive-hint {
  position: fixed;
  z-index: 10;
  bottom: 15px;
  left: 50%;
  margin: 0;
  font-size: .78rem;
  line-height: .95;
  transform: translateX(-50%);
  transition: opacity .35s ease;
  pointer-events: none;
}

.archive-hint.is-hidden { opacity: 0; }

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

.archive-lightbox {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 58px var(--edge) 44px;
  background: rgba(255, 255, 255, .97);
}

.lightbox-figure {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

.lightbox-image {
  display: block;
  max-width: min(92vw, 1500px);
  max-height: calc(100vh - 125px);
  object-fit: contain;
}

.lightbox-caption {
  position: fixed;
  bottom: 17px;
  left: 50%;
  margin: 0;
  font-size: .82rem;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
}

.gerontophilia-page .lightbox-caption {
  color: #b8b8b8;
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: -.015em;
  text-transform: uppercase;
}

.lightbox-close {
  position: fixed;
  z-index: 2;
  top: 16px;
  right: var(--edge);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.lightbox-close:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  :root { --edge: 14px; --gap: 7px; }
  .archive-header { top: 14px; font-size: .82rem; }
  .archive-track {
    padding: 54px var(--edge) 40px;
  }
  .archive-cell figcaption { right: 6px; bottom: 5px; left: 6px; font-size: .62rem; }
  .archive-hint { bottom: 12px; }
  .archive-lightbox { padding: 48px 14px 40px; }
  .lightbox-image { max-width: 100%; max-height: calc(100vh - 105px); }
  .lightbox-caption { bottom: 14px; font-size: .75rem; }
  .gerontophilia-page .lightbox-caption { font-size: .68rem; }
  .lightbox-close { top: 14px; right: 14px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .archive-card img,
  .archive-hint { transition: none; }
}
