/* People Watching — static rebuild of gallery.institute/people-watching */

:root {
  --blue: #0015ff;
  --pill-blue: #0000ff;
  --mono: "DM Mono", ui-monospace, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.1875;
  background-size: .9rem .9rem;
}

.theme-light {
  --bg: #e8e9ea;
  --thumb: #000;
  background-color: var(--bg);
  background-image: radial-gradient(circle, #d3d4d6 .9px, transparent .9px);
  background-attachment: fixed;
  color: #000;
}

.theme-dark {
  --bg: #1b1b1b;
  --thumb: #fff;
  background-color: var(--bg);
  background-image: radial-gradient(circle, #303030 .9px, transparent .9px);
  color: #fff;
}

a { color: var(--blue); text-decoration: none; }

::selection { background-color: var(--blue); color: #fff; }

body::-webkit-scrollbar { width: 18px; }
body::-webkit-scrollbar-track { background-color: var(--bg); }
body::-webkit-scrollbar-thumb {
  border-radius: 100px;
  border: 5px solid transparent;
  background-clip: content-box;
  background-color: var(--thumb);
}

/* ---------- Home ---------- */

.home-drawing {
  position: fixed;
  top: 0;
  left: 0;
  width: 66.6667%;
  z-index: 2;
  pointer-events: none;
}
.home-drawing img {
  display: block;
  width: 100%;
  height: auto;
}

.home-intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 15px;
  pointer-events: none;
}
.home-logo {
  margin: 0;
  width: 58.3333%;
  padding-right: 15px;
}
.home-logo img { display: block; width: 100%; height: auto; }
.home-blurb {
  width: 33.3333%;
  padding: 20px 0 0 15px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 130%;
  letter-spacing: -0.02vw;
  pointer-events: auto;
}
.home-blurb p { margin: 0 0 1.3em; }
.home-blurb span {
  background: #e8e9ea;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.artist-list {
  position: relative;
  z-index: 0;
  margin-top: 40vh;
  padding: 0 15px 140px;
  text-align: right;
}
.artist-list h2 {
  margin: 0;
  font-size: calc(12px + .5vw);
  line-height: 130%;
  color: #fff;
  text-transform: uppercase;
}
.artist-list ol { list-style: none; margin: 0; padding: 0 0 20px; }
.artist-list li {
  font-size: calc(24px + 4vw);
  font-weight: bold;
  letter-spacing: -0.4vw;
  line-height: 105%;
  color: #fff;
}

.wrong-badge {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
  font-family: var(--mono);
  font-size: 18px;
}
/* The PNG has transparent padding (22px of 400 on the left); pull it back so the wordmark lines up with the text. */
.wrong-badge img { display: block; width: 360px; max-width: 100%; height: auto; margin: -18px 0 -43px -20px; }
/* Narrower desktops: lift the badge above the centred nav pill so they don't collide. */
@media (max-width: 1100px) {
  .wrong-badge { bottom: 84px; }
}

/* ---------- Artist pages ---------- */

.work { padding: 0 15px 20px; }
.work-title {
  margin: 0;
  padding-top: 20px;
  font-size: calc(18px + 2vw);
  font-weight: normal;
  letter-spacing: -0.2vw;
  line-height: 100%;
  color: #fff;
}
.work-title strong { font-weight: bold; }
.work-desc {
  width: 50%;
  margin: 0;
  padding: 20px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: #d3d3d3;
}
.work-img {
  display: block;
  width: 100%;
  max-width: 2560px;
  height: auto;
  margin: 0 auto;
}

.next-prev {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 40px 15px 140px;
}
.next-prev a {
  display: block;
  color: #fff;
  font-size: calc(18px + 2vw);
  font-weight: bold;
  letter-spacing: -0.2vw;
  line-height: 100%;
}
.next-prev span {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #d3d3d3;
}
.np-next { text-align: right; margin-left: auto; }

/* ---------- Info page ---------- */

.info-page { padding: 0 15px 140px; }
.info-text {
  padding-top: 20px;
  font-size: calc(18px + 2vw);
  letter-spacing: -0.2vw;
  line-height: 100%;
}
.info-text p { margin: 0 0 1em; }
.info-video {
  display: block;
  width: 377px;
  max-width: 100%;
  height: 222px;
  object-fit: cover;
  border: 1px solid #fff;
  border-radius: 6px;
}
.info-quote,
.info-license {
  width: 50%;
  margin: 0;
  padding: 20px 0 0;
  font-family: var(--mono);
  font-size: 11px;
}
.info-license { color: #4f4f4f; }

/* ---------- Site nav: prev/next, artist picker and Info in one pill ---------- */

.pw-nav {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 999999;
  transform: translateX(-50%);
  font-family: var(--sans);
  line-height: 1;
}

/* Heavy blur over the whole page while the artist sheet is open.
   Lives on body, not .pw-nav, because the nav's transform would trap a fixed child. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(60px);
  backdrop-filter: blur(60px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s .35s;
}
.nav-open body::before {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease;
}

.pill {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 4px;
  border-radius: 26px;
  background: var(--pill-blue);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  white-space: nowrap;
}
.btn {
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 22px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background .2s;
}
.btn:hover,
.btn:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }
.step { font-size: 22px; padding-bottom: 3px; }
.mid { padding: 0 14px; max-width: min(62vw, 360px); }
.pw-nav .num {
  font-family: var(--mono);
  font-size: 11px;
  opacity: .65;
  font-variant-numeric: tabular-nums;
}
.ttl {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.caret { font-size: 9px; opacity: .65; transition: transform .25s; }
.open .caret { transform: rotate(180deg); }

.sheet {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(calc(100vw - 32px), 420px);
  max-height: min(560px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 22px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 20px 50px rgba(0, 0, 0, .35);
  transform: translate(-50%, 8px) scale(.98);
  transform-origin: 50% 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s, transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s .28s;
}
.open .sheet {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
  transition: opacity .22s, transform .28s cubic-bezier(.2, .7, .2, 1);
}
.filter {
  flex: none;
  margin: 4px 4px 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 14px;
  background: transparent;
  color: #fff;
  font: 12px var(--mono);
  outline: none;
}
.filter::placeholder { color: rgba(255, 255, 255, .5); }
.filter:focus { border-color: #fff; }
.sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet ul::-webkit-scrollbar { width: 14px; }
.sheet ul::-webkit-scrollbar-thumb {
  border-radius: 100px;
  border: 4px solid transparent;
  background-clip: content-box;
  background-color: rgba(255, 255, 255, .5);
}
.row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 14px;
  color: #fff;
  transition: background .2s, color .2s;
}
.row .t { font-size: 15px; line-height: 1.2; }
.row:hover,
.row:focus-visible { background: #fff; color: #000; outline: none; }
.row[aria-current] { background: var(--pill-blue); color: #fff; }
.row[aria-current] .num { opacity: 1; }
.foot {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 12px 6px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font: 11px var(--mono);
  text-transform: uppercase;
}
.foot a { color: #fff; opacity: .7; }
.foot a:hover, .foot a[aria-current] { opacity: 1; }
.foot span { opacity: .35; }

/* ---------- Intro: everything fades in and rises a little, in reading order ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.home-logo, .home-drawing img, .home-blurb, .artist-list h2, .artist-list li, .wrong-badge,
.work-title, .work-desc, .work-img, .next-prev,
.info-text p, .info-video, .info-quote, .info-license,
.pill {
  animation: rise 1.1s cubic-bezier(.22, .61, .36, 1) var(--d, 0s) both;
}

.home-logo { --d: .05s; }
.home-drawing img { --d: .2s; animation-duration: 1.6s; }
.home-blurb { --d: .3s; }
.artist-list h2 { --d: .4s; }
.artist-list li { --d: calc(.45s + var(--i, 12) * .05s); }
.wrong-badge { --d: .9s; }

.work-title { --d: .05s; }
.work-desc { --d: .18s; }
.work-img { --d: .3s; }
.next-prev { --d: .4s; }

.info-text p { --d: calc(.05s + var(--i, 6) * .08s); }
.info-video { --d: .6s; }
.info-quote { --d: .7s; }
.info-license { --d: .78s; }

.pill { --d: .5s; }

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
  .home-drawing { width: 100%; z-index: -1; }
  .home-intro { flex-direction: column; }
  .home-logo, .home-blurb { width: 100%; padding-right: 0; padding-left: 0; }
  .home-blurb { padding-top: 10px; }
  .artist-list { margin-top: 60vh; padding-bottom: 260px; }
  .work-desc, .info-quote, .info-license { width: 100%; }
  .next-prev { flex-direction: column; gap: 24px; }
  .wrong-badge { bottom: 84px; left: 16px; font-size: 14px; }
  .wrong-badge img { width: 240px; margin: -12px 0 -29px -13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
