:root {
  --ink: #111;
  --mute: #8a8a8a;
  --line: #e6e6e6;
  --ground: #fff;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 300 14px/1.6 var(--sans);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--mute); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* header */
.site-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 26px var(--gutter);
  position: relative; z-index: 2;
}
.brand { font: 700 38px/1 Arial, sans-serif; letter-spacing: -.02em; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--mute); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* hero rock */
.hero {
  position: relative;
  height: min(78vh, 760px);
  min-height: 420px;
  margin-top: -90px;            /* let the rock sit under the header */
}
.hero canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
.hero canvas.dragging { cursor: grabbing; }
.hero-line {
  position: absolute; left: var(--gutter); bottom: 28px;
  margin: 0; max-width: 22em;
  font-size: 14px; pointer-events: none;
}
.welcome {
  position: absolute; right: calc(50% + 190px); top: 140px;   /* 50px below the header, just left of the rock */
  margin: 0; white-space: nowrap;
  font: 13px/1.5 Arial, sans-serif; pointer-events: none; z-index: 1;
}
.hero-hint {
  position: absolute; right: var(--gutter); bottom: 28px;
  margin: 0; color: var(--mute); font-size: 12px; pointer-events: none;
  transition: opacity .6s;
}
.hero.touched .hero-hint { opacity: 0; }
.hero-hint .tap { display: none; }
@media (hover: none) {
  .hero-hint .tap { display: inline; }
  .hero-hint .click { display: none; }
}

/* works grid */
.works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 64px) clamp(20px, 3vw, 48px);
  padding: 72px var(--gutter) 120px;
  max-width: 1320px; margin: 0 auto;
}
.tile img {
  aspect-ratio: 1; width: 100%; height: auto; object-fit: cover;
  background: #f4f4f4;
  transition: opacity .3s;
}
.tile:hover img { opacity: .88; }
.tile:hover { color: inherit; }
.tile-cap {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 12px; font-size: 13px;
}
.tile-cap .price { color: var(--mute); }

/* single work */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 5vw, 80px);
  padding: 24px var(--gutter) 64px;
  max-width: 1320px; margin: 0 auto;
}
.viewer { min-width: 0; }
.stage {
  position: relative; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.stage img {
  max-width: 100%; max-height: 100%; width: auto; height: 100%;
  object-fit: contain;
}
.thumbs { display: flex; gap: 10px; margin-top: 14px; }
.thumbs button {
  padding: 0; border: 0; background: none; cursor: pointer;
  width: 64px; height: 64px; opacity: .45; transition: opacity .2s;
}
.thumbs button[aria-current="true"], .thumbs button:hover { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.info { align-self: start; position: sticky; top: 28px; }
.info h1 { font-size: 18px; font-weight: 400; margin: 0 0 18px; letter-spacing: .01em; }
.facts { margin: 0 0 24px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; text-align: right; }

.buy {
  display: block; width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font: 400 13px var(--sans); letter-spacing: .06em; text-transform: uppercase;
  text-align: center; cursor: pointer;
  transition: background .2s, color .2s;
}
.buy:hover { background: #fff; color: var(--ink); }
.buy.ghost { background: #fff; color: var(--ink); }
.buy.ghost:hover { background: var(--ink); color: #fff; }
.buy[aria-disabled="true"] { background: #fff; color: var(--mute); border-color: var(--line); cursor: default; }
.fine { color: var(--mute); font-size: 12px; margin: 14px 0 0; }
.fine a { text-decoration: underline; text-underline-offset: 2px; }

.pager {
  display: flex; justify-content: space-between;
  padding: 0 var(--gutter) 96px; max-width: 1320px; margin: 0 auto;
  color: var(--mute);
}
.pager a:hover { color: var(--ink); }

/* text pages */
.page {
  max-width: 560px;
  padding: 72px var(--gutter) 140px;
  margin: 0 0 0 max(var(--gutter), calc((100vw - 1320px) / 2 + var(--gutter)));
}
.page h1 { font-size: 18px; font-weight: 400; margin: 0 0 28px; }
.page h2 { font-size: 14px; font-weight: 400; margin: 36px 0 8px; }
.page p { margin: 0 0 14px; }
.page .mute { color: var(--mute); }
.page a { text-decoration: underline; text-underline-offset: 2px; }

/* footer */
.site-foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  color: var(--mute); font-size: 12px;
}
.site-foot a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .works { grid-template-columns: repeat(2, 1fr); padding-top: 48px; }
  .work { grid-template-columns: 1fr; }
  .info { position: static; }
}
@media (max-width: 560px) {
  .nav { gap: 16px; }
  .site-head { flex-direction: column; gap: 8px; }
  .hero { margin-top: -110px; height: 64vh; min-height: 380px; }
  .brand { font-size: 30px; }
  .hero-line { right: var(--gutter); bottom: 22px; }
  .welcome { top: 160px; left: var(--gutter); right: auto; }
  .hero-hint { display: none; }
  .works { gap: 32px 16px; }
  .tile-cap { flex-direction: column; gap: 0; }
  .page { margin: 0; padding-top: 40px; }
}
