/* --------------------------------------------
   BARNEY GOODMAN - PHOTOGRAPHS  ·  Swiss gallery white
   type: Archivo (wdth axis) + IBM Plex Mono
   palette: #FAFAF7 paper · #0B0B0A ink · #E10600 signal red
-------------------------------------------- */

:root {
  --paper: #fafaf7;
  --ink: #0b0b0a;
  --red: #e10600;
  --grey: #9a9a94;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ≈ power3.out */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 500;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

@media (pointer: coarse) { body { cursor: auto; } }

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- canvas --- */
#gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none; /* keep pointer events alive for strip/river drag */
}

/* --- film grain --- */
.grain {
  position: fixed; inset: -100px;
  z-index: 40;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-34px, 22px); }
  50% { transform: translate(18px, -40px); }
  75% { transform: translate(-26px, -14px); }
  100% { transform: translate(0, 0); }
}

/* --- preloader --- */
.loader {
  position: fixed; inset: 0;
  z-index: 60;
  background: var(--ink);
  display: grid; place-items: center;
}
.loader__text {
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.32em;
}
.loader__bar {
  position: absolute; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--red);
}
.loader__curve {
  position: absolute; bottom: -11.5%; left: 0;
  width: 100%; height: 12%;
}

/* --- chrome shared --- */
.chrome { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.chrome a, .chrome button { pointer-events: auto; }

/* reveal-line: masked text entrances */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: inline-block; transform: translateY(110%); }

/* --- masthead --- */
.masthead { position: absolute; top: 34px; left: 38px; }
.kicker { color: var(--grey); margin-bottom: 10px; }
.masthead__name {
  font-variation-settings: "wdth" 122, "wght" 800;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 0.94;
  letter-spacing: -0.01em;
}

/* --- side nav --- */
.sidenav {
  position: absolute; top: 38px; right: 38px;
  display: flex; flex-direction: column; gap: 7px;
  text-align: right;
  color: var(--grey);
}
.sidenav__active { color: var(--ink); position: relative; }
.sidenav__active > span::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 9px;
  background: var(--red);
  border-radius: 50%;
  transform: translateY(-1px);
}

/* --- hover meta (bottom-left) --- */
.hovermeta { position: absolute; left: 38px; bottom: 36px; }
.hovermeta__idx { color: var(--red); margin-bottom: 8px; }
.hovermeta__title {
  font-variation-settings: "wdth" 118, "wght" 800;
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.hovermeta__sub { color: var(--grey); margin-top: 10px; }

.corner { position: absolute; right: 38px; bottom: 40px; color: var(--grey); }

/* --- overlay chrome --- */
.chrome--overlay { z-index: 32; visibility: hidden; }

.closebtn {
  position: absolute; top: 30px; left: 38px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  cursor: none;
  display: grid; place-items: center;
}
.closebtn span {
  position: absolute;
  width: 16px; height: 1.6px;
  background: var(--paper);
  transform: rotate(45deg);
}
.closebtn span:last-child { transform: rotate(-45deg); }
.closebtn:hover { background: var(--red); }

.ovhead { position: absolute; top: 30px; left: 0; right: 0; text-align: center; }
.ovhead__kicker { color: var(--grey); margin-bottom: 6px; }
.ovhead__title {
  font-variation-settings: "wdth" 122, "wght" 800;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: 0.005em;
}

.ovcounter { position: absolute; right: 38px; top: 42px; }

.ovcaption {
  position: absolute; left: 38px; bottom: 108px;
  max-width: 420px;
  font-size: 15px;
  font-variation-settings: "wdth" 100, "wght" 500;
  color: var(--ink);
  line-height: 1.45;
}

/* filmstrip switcher */
.filmstrip {
  position: absolute; right: 38px; bottom: 32px;
  display: flex; gap: 8px;
  pointer-events: auto;
}
.filmstrip button {
  width: 52px; height: 38px;
  padding: 0; border: 1px solid rgba(11,11,10,0.18);
  background: #eee;
  background-size: cover; background-position: center;
  cursor: none;
  opacity: 0.55;
  filter: grayscale(1);
  transition: opacity 0.35s var(--ease), filter 0.35s var(--ease), transform 0.35s var(--ease);
}
.filmstrip button:hover { opacity: 0.9; filter: grayscale(0.2); }
.filmstrip button.is-active {
  opacity: 1; filter: none;
  border-color: var(--red);
  transform: translateY(-4px);
}

/* --- sidenav buttons --- */
.sidenav__item {
  border: none; background: none;
  font: inherit; letter-spacing: inherit;
  color: var(--grey);
  text-align: right;
  cursor: none;
  padding: 0;
  pointer-events: auto;
  transition: color 0.3s var(--ease);
}
.sidenav__item:hover { color: var(--ink); }
.sidenav__item.is-active { color: var(--ink); }
/* external nav links (anchor variant of the same item) */
a.sidenav__item { text-decoration: none; display: block; cursor: none; }
.sidenav__ext > span::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.sidenav__ext:hover > span::after { transform: scaleX(1); }
.sidenav__item.is-active > span::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 9px;
  background: var(--red);
  border-radius: 50%;
  transform: translateY(-1px);
}

/* --- views (INDEX / INFO) --- */
.view {
  position: fixed; inset: 0;
  z-index: 20;
  visibility: hidden;
  opacity: 0;
  background: var(--paper);
}
.view__scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 150px 38px 90px;
}

.idxhead { margin-bottom: 42px; }
.idxhead__kicker { color: var(--red); margin-bottom: 8px; }
.idxhead__title {
  font-variation-settings: "wdth" 122, "wght" 800;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.95;
}

/* index table */
.idxtable { border-top: 1px solid rgba(11,11,10,0.16); }
.idxrow {
  display: grid;
  grid-template-columns: 84px 1fr 220px 60px;
  gap: 18px;
  align-items: baseline;
  width: 100%;
  padding: 13px 0;
  border: none; border-bottom: 1px solid rgba(11,11,10,0.16);
  background: none;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: none;
  pointer-events: auto;
  transition: padding-left 0.35s var(--ease);
}
.idxrow:hover { padding-left: 14px; }
.idxrow:hover .idxrow__no { color: var(--red); }
.idxrow__no { color: var(--grey); }
.idxrow__caption {
  font-size: clamp(15px, 1.5vw, 19px);
  font-variation-settings: "wdth" 106, "wght" 640;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idxrow__col { color: var(--grey); text-align: right; }
.idxrow__arrow { text-align: right; color: var(--grey); }
.idxrow:hover .idxrow__arrow { color: var(--ink); }
.idxfoot { color: var(--grey); margin-top: 28px; }

/* floating hover preview */
.idxpreview {
  position: fixed; top: 0; left: 0;
  width: 300px; height: auto;
  max-height: 220px;
  object-fit: cover;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -110%) rotate(2deg);
  box-shadow: 0 18px 60px rgba(11,11,10,0.28);
}

/* info view */
.info { max-width: 860px; }
.info__lead {
  font-size: clamp(19px, 2.4vw, 30px);
  line-height: 1.42;
  font-variation-settings: "wdth" 102, "wght" 560;
  max-width: 30ch;
  margin-bottom: 58px;
}
.info__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 34px;
  border-top: 1px solid rgba(11,11,10,0.16);
  padding-top: 26px;
}
.info__label { color: var(--grey); margin-bottom: 9px; }
.info__value {
  font-size: 14px;
  line-height: 1.7;
  font-variation-settings: "wdth" 108, "wght" 620;
  letter-spacing: 0.02em;
}
.info__value a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  cursor: none;
  pointer-events: auto;
}
.info__value a:hover { color: var(--red); }
.info__foot { color: var(--grey); margin-top: 70px; }

@media (pointer: coarse) {
  .idxpreview { display: none !important; }
}

@media (max-width: 720px) {
  .view__scroll { padding: 130px 20px 70px; }
  .idxrow { grid-template-columns: 56px 1fr 42px; }
  .idxrow__col { display: none; }
  .idxpreview { display: none; }
}

/* --- contact button (strip view) --- */
.contactbtn {
  position: absolute; top: 34px; left: 50%;
  transform: translateX(-50%);
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: none;
  pointer-events: auto;
  opacity: 0;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.contactbtn:hover { background: var(--red); transform: translateX(-50%) translateY(-2px); }

/* --- contact view --- */
.contact { max-width: 1100px; }
.contact__mail {
  display: inline-block;
  font-variation-settings: "wdth" 112, "wght" 720;
  font-size: clamp(19px, 2.6vw, 38px);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
  padding-bottom: 4px;
  cursor: none;
  pointer-events: auto;
  margin: 10px 0 64px;
  transition: color 0.3s var(--ease);
  word-break: break-all;
}
.contact__mail:hover { color: var(--red); }
.contact__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
  gap: 34px;
  border-top: 1px solid rgba(11,11,10,0.16);
  padding-top: 26px;
}

@media (max-width: 720px) {
  .contactbtn { top: auto; bottom: 88px; }
}

/* --- custom cursor --- */
.cursor {
  position: fixed; top: 0; left: 0;
  z-index: 50;
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--ink);
  display: grid; place-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background 0.35s var(--ease);
}
.cursor span {
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.cursor.is-hover {
  width: 86px; height: 86px;
  background: var(--red);
}
.cursor.is-hover span { opacity: 1; transition-delay: 0.12s; }
@media (pointer: coarse) { .cursor { display: none; } }

/* small screens */
@media (max-width: 720px) {
  .masthead { top: 24px; left: 20px; }
  .sidenav { top: 26px; right: 20px; }
  .hovermeta { left: 20px; bottom: 26px; }
  .corner { display: none; }
  .closebtn { top: 20px; left: 20px; }
  .ovcounter { right: 20px; }
  .ovcaption { left: 20px; bottom: 96px; font-size: 13px; max-width: 78vw; }
  .filmstrip { right: 20px; bottom: 24px; }
  .filmstrip button { width: 40px; height: 30px; }
}

/* filmstrip dimmed while a photograph is focused */
.filmstrip.is-dim { opacity: 0.15; pointer-events: none; transition: opacity 0.36s var(--ease); }
.filmstrip { transition: opacity 0.36s var(--ease); }
