:root {
  color-scheme: dark;
  --ink: #0a0a09;
  --paper: #ebe7dc;
  --mono: "SFMono-Regular", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", Baskerville, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, main { width: 100%; min-height: 100%; background: #050605; }
body { color: var(--paper); font-family: var(--mono); text-rendering: optimizeLegibility; }
button, a { color: inherit; font: inherit; }
button { border: 0; }
a { text-decoration: none; }
::selection { background: #7254a6; color: var(--paper); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.photo-grid-section--horse {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: rgba(6, 7, 6, .58);
  isolation: isolate;
}
.photo-grid-section--horse::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(20, 25, 21, .38), rgba(4, 5, 4, .8));
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  pointer-events: none;
}
.photo-grid-section--horse #c {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.photo-grid-section__intro {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 5vw, 76px);
  top: clamp(36px, 8vh, 90px);
  width: min(410px, 36vw);
  color: var(--paper);
  pointer-events: none;
}
.photo-grid-section__intro p {
  margin-bottom: 18px;
  font-size: 7px;
  letter-spacing: .16em;
  color: rgba(240, 241, 232, .55);
}
.photo-grid-section__intro button {
  pointer-events: auto;
  margin-top: 25px;
  padding: 11px 14px;
  border: 1px solid rgba(240, 241, 232, .38);
  background: rgba(9, 9, 8, .56);
  color: var(--paper);
  font-size: 8px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.photo-grid-section__intro button:hover,
.photo-grid-section__intro button:focus-visible {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
  outline: 0;
}

/* Link between the photo version and the assets-free glyph version. Same visual
   language as the button above, but it is a link because it navigates. */
.photo-grid-section__switch {
  display: inline-block;
  pointer-events: auto;
  margin-top: 25px;
  padding: 11px 14px;
  border: 1px solid rgba(240, 241, 232, .38);
  background: rgba(9, 9, 8, .56);
  color: var(--paper);
  font-size: 8px;
  letter-spacing: .14em;
  text-decoration: none;
  transition: background .25s, color .25s, transform .25s;
}
.photo-grid-section__switch:hover,
.photo-grid-section__switch:focus-visible {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
  outline: 0;
}

.photo-grid-section__hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  width: max-content;
  padding: 9px 13px;
  border: 1px solid rgba(245, 248, 240, .14);
  border-radius: 999px;
  background: rgba(10, 13, 11, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 8px;
  letter-spacing: .14em;
  color: rgba(240, 241, 232, .72);
  pointer-events: none;
}

/* Scripts disabled: the canvas never paints, so say so instead of showing a void. */
.photo-grid-section__noscript {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(46ch, calc(100% - 48px));
  padding: 20px 22px;
  border: 1px solid rgba(245, 248, 240, .16);
  border-radius: 14px;
  background: rgba(10, 13, 11, .6);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .04em;
  text-align: center;
  color: rgba(240, 241, 232, .8);
}

.photo-grid-section__noscript a { color: inherit; }

.site-credit {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 5vw, 76px);
  right: clamp(22px, 5vw, 76px);
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: .14em;
  color: rgba(240, 241, 232, .45);
  pointer-events: none;
}
.site-credit a { pointer-events: auto; }
.site-credit a:hover, .site-credit a:focus-visible { color: var(--paper); outline: 0; }

.horse-reveal {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 4;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0);
}
.horse-reveal__media {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transform: scale(.5);
  transform-origin: 50% 50%;
  opacity: 0;
  transition: transform .6s cubic-bezier(.7, 0, .3, 1), opacity .45s cubic-bezier(.7, 0, .3, 1);
  will-change: transform, opacity;
}
.horse-reveal.is-on .horse-reveal__media { transform: scale(1); opacity: 1; }
.horse-reveal__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px 9px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent);
  color: #f2f0e9;
  font-size: 9px;
  letter-spacing: .05em;
  opacity: 0;
  transition: opacity .3s .12s;
}
.horse-reveal.is-on .horse-reveal__cap { opacity: 1; }
/* Captions are optional. With none set, the strip would still paint its gradient
   over the bottom of the photograph for no reason. */
.horse-reveal__cap:empty { display: none; }
.photo-grid-section--horse:focus-visible { outline: 2px solid rgba(120, 191, 255, .7); outline-offset: -6px; }
.horse-reveal-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The lightbox and the gallery are closed by setting the `hidden` attribute, but both
   declare `display: flex` below — and an author rule beats the browser's default
   `[hidden] { display: none }`. Without this they stay laid out: invisible, full-screen,
   z-index 150/200 layers that swallow every pointer event before it reaches the canvas,
   which kills the hover reveal entirely. Keep these two rules next to the display ones. */
.horse-lightbox[hidden],
.horse-gallery[hidden] { display: none; }

.horse-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  padding: 4vh 3vw;
  background: rgba(8, 8, 7, 0);
  opacity: 0;
  transition: opacity .3s ease, background .3s ease;
}
.horse-lightbox.is-open { opacity: 1; background: rgba(8, 8, 7, .93); }
.horse-lightbox__stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 88vw;
  max-height: 88vh;
  transform: scale(.96);
  transition: transform .35s cubic-bezier(.7, 0, .3, 1);
}
.horse-lightbox.is-open .horse-lightbox__stage { transform: scale(1); }
.horse-lightbox__img { max-width: 86vw; max-height: 80vh; object-fit: contain; background: #111; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.horse-lightbox__meta { display: flex; gap: 16px; align-items: center; font-size: 10px; letter-spacing: .14em; color: rgba(240, 241, 232, .72); }
.horse-lightbox__meta .count { color: rgba(240, 241, 232, .45); }
.horse-lightbox__nav, .horse-lightbox__close {
  border: 0;
  background: rgba(240, 241, 232, .06);
  color: #f2f0e9;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .2s;
}
.horse-lightbox__nav { width: 52px; height: 52px; font-size: 26px; flex: none; }
.horse-lightbox__nav:hover, .horse-lightbox__close:hover { background: rgba(240, 241, 232, .16); }
.horse-lightbox__close { position: absolute; top: 18px; right: 20px; width: 40px; height: 40px; font-size: 15px; }

.horse-gallery {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: rgba(11, 10, 9, 0);
  opacity: 0;
  transition: opacity .32s ease, background .32s ease;
}
.horse-gallery.is-open { opacity: 1; background: #0b0a09; }
.horse-gallery__bar { flex: none; display: flex; align-items: center; gap: 16px; padding: 18px 28px; border-bottom: 1px solid rgba(240, 241, 232, .1); font-size: 11px; letter-spacing: .18em; color: #f2f0e9; }
.horse-gallery__title { font-weight: 600; }
.horse-gallery__count { color: rgba(240, 241, 232, .45); }
.horse-gallery__close { margin-left: auto; border: 0; background: rgba(240, 241, 232, .06); color: #f2f0e9; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; transition: background .2s; }
.horse-gallery__close:hover { background: rgba(240, 241, 232, .16); }
.horse-gallery__grid { flex: 1; overflow-y: auto; padding: 22px 28px 60px; column-gap: 14px; column-count: 5; }
.horse-gallery__item { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: none; cursor: zoom-in; break-inside: avoid; overflow: hidden; line-height: 0; border-radius: 1px; }
.horse-gallery__item img { width: 100%; height: auto; display: block; filter: saturate(.92); transition: transform .5s cubic-bezier(.7, 0, .3, 1), filter .3s; }
.horse-gallery__item:hover img, .horse-gallery__item:focus-visible img { transform: scale(1.045); filter: saturate(1); }

@media (max-width: 1100px) { .horse-gallery__grid { column-count: 3; } }
@media (max-width: 700px) {
  .photo-grid-section--horse { min-height: 680px; }
  .photo-grid-section__intro { left: 18px; top: 32px; width: calc(100% - 36px); }
  .photo-grid-section__intro p { margin-bottom: 11px; font-size: 6px; }
  .photo-grid-section__intro button { margin-top: 16px; padding: 10px 11px; font-size: 7px; }
  .photo-grid-section__hint { bottom: 20px; max-width: calc(100% - 36px); white-space: normal; text-align: center; font-size: 6px; line-height: 1.6; }
  .site-credit { display: none; }
  .horse-lightbox { gap: 6px; padding: 2vh 2vw; }
  .horse-lightbox__nav { width: 40px; height: 40px; font-size: 20px; }
  .horse-lightbox__img { max-height: 72vh; }
  .horse-gallery__grid { column-count: 2; padding: 16px 14px 50px; }
  .horse-gallery__bar { padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .horse-reveal__media, .horse-lightbox, .horse-lightbox__stage, .horse-gallery, .horse-gallery__item img { transition: opacity .2s; }
  .horse-reveal.is-on .horse-reveal__media { transform: scale(1); }
}
