/* =========================================================
   Camel Cross — gallery wall hero
   ========================================================= */

@property --cx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --cy { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --r  { syntax: '<length>';     inherits: true; initial-value: 10px; }

/* background picks up the wall's own tones so the photo edges disappear */
.gw { background: linear-gradient(#EBE9E5, #DDDAD4); }

/* full screen: the hero fills everything under the site header */
.gw { --avail: calc(100svh - var(--head-h)); }
.gw-stage {
  position: relative; overflow: hidden;
  height: var(--avail);
}

/* title + controls float over the top of the photo */
.gw-head {
  position: absolute; inset-inline: 0; top: 0; z-index: 5; pointer-events: none;
  padding: clamp(14px, 2vw, 24px) clamp(16px, 3vw, 44px) clamp(28px, 4vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 6px 28px; flex-wrap: wrap;
  align-content: center;
  background: linear-gradient(rgba(238,236,232,.7), rgba(238,236,232,0));
}
.gw-head .gw-ctrl { pointer-events: auto; margin-inline-start: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gw-eyebrow { width: 100%; font-size: 11px; font-weight: 700; color: var(--grey); letter-spacing: .05em; }
html[lang="en"] .gw-eyebrow { text-transform: uppercase; letter-spacing: .16em; }
.gw-title { font-family: var(--disp); font-weight: 900; font-size: clamp(24px, 2.5vw, 40px); line-height: 1.15; }
html[lang="en"] .gw-title { font-weight: 400; text-transform: uppercase; }
.gw-title mark { background: var(--blue); color: #fff; padding-inline: .14em; }
.gw-ctrl { display: flex; align-items: center; gap: 22px; }
.gw-hint { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--grey); }
.gw-hint i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0,43,255,.5); animation: gw-ping 1.8s infinite;
}
@keyframes gw-ping { 70% { box-shadow: 0 0 0 10px rgba(0,43,255,0); } 100% { box-shadow: 0 0 0 0 rgba(0,43,255,0); } }

/* slide counter: number, name and a bar that fills while autoplay waits */
.gw-dots { display: flex; gap: 16px; }
.gw-dots button { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; text-align: start; opacity: .45; transition: opacity .25s; }
.gw-dots button.on, .gw-dots button:hover { opacity: 1; }
.gw-dots .n { font-family: var(--disp); font-weight: 900; font-size: 15px; }
.gw-dots .t { font-size: 12px; font-weight: 700; }
html[lang="en"] .gw-dots .t { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.gw-dots i { grid-column: 1 / -1; height: 2px; margin-top: 5px; background: rgba(10,10,10,.15); position: relative; overflow: hidden; }
.gw-dots i::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  transform: scaleX(0); transform-origin: var(--from, right);
}
html[dir="ltr"] .gw-dots i::after { --from: left; }
.gw-dots button.on i::after { transform: scaleX(1); }
.gw.playing .gw-dots button.on i::after { animation: gw-fill var(--dur, 8s) linear; }
@keyframes gw-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.gw-arrows { display: flex; gap: 8px; }
.gw-arrows button {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ink); font-size: 15px;
  transition: background .2s, color .2s;
}
.gw-arrows button:hover { background: var(--ink); color: var(--cream); }
html[dir="ltr"] .gw-arrows button { rotate: 180deg; }

/* slides share one grid cell; the active one fades and settles in */
.gw-slides { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.gw-slide {
  grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .9s var(--ease), visibility 0s .9s;
}
.gw-slide.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .9s var(--ease); }
.gw-slide .gw-img { transform: scale(1.035); transition: transform 1.6s var(--ease); }
.gw-slide.on .gw-img { transform: none; }

/* headline written on the empty wall above the shelf */
.gw-cap {
  position: absolute; inset-inline-start: 5.5%; top: 17%; z-index: 1; color: var(--ink);
  opacity: 0; transform: translateY(1.2cqw); transition: opacity .8s var(--ease) .35s, transform .9s var(--ease) .35s;
}
.gw-slide.on .gw-cap { opacity: 1; transform: none; }
.gw-cap span { font-size: max(11px, .9cqw); font-weight: 700; color: var(--grey); letter-spacing: .04em; }
html[lang="en"] .gw-cap span { text-transform: uppercase; letter-spacing: .16em; }
.gw-cap h2 { font-family: var(--disp); font-weight: 900; font-size: 4.6cqw; line-height: 1.12; margin-top: .8cqw; }
html[lang="en"] .gw-cap h2 { font-weight: 400; text-transform: uppercase; line-height: 1.02; }
.gw-cap mark { background: var(--blue); color: #fff; padding-inline: .12em; }

/* the photo and everything placed on it share one coordinate box */
.gw-scroll { position: relative; height: 100%; overflow: hidden; scrollbar-width: none; }
.gw-scroll::-webkit-scrollbar { display: none; }
.gw-frame {
  --cx: 50%; --cy: 50%; --r: 120px;
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; container-type: inline-size;
  width: max(100%, calc(var(--avail) * var(--ratio, 1.777)));
  transition: --cx .7s var(--ease), --cy .7s var(--ease), --r .7s var(--ease), translate 1.1s var(--ease);
}
.gw-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* the rest of the room fades back toward the wall (lighter, less colour),
   leaving the hovered piece clear: a soft focus, not a blackout */
.gw-dim {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: rgba(240, 237, 231, .5);
  -webkit-backdrop-filter: saturate(.45); backdrop-filter: saturate(.45);
  -webkit-mask: radial-gradient(circle at var(--cx) var(--cy), transparent var(--r), #000 calc(var(--r) + 14cqw));
          mask: radial-gradient(circle at var(--cx) var(--cy), transparent var(--r), #000 calc(var(--r) + 14cqw));
  opacity: 0; transition: opacity .7s var(--ease);
}
.gw-frame.is-hot .gw-dim { opacity: 1; }

.gw-layer { position: absolute; inset: 0; z-index: 2; }

/* pieces: invisible until hovered, then lifted off the wall */
.gw-piece { position: absolute; display: block; outline: none; }
.gw-piece.round { border-radius: 50%; }
.gw-lift {
  position: absolute; inset: 0; display: block;
  opacity: 0; transition: opacity .35s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}
.gw-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.gw-piece.round .gw-art { clip-path: circle(48.6% at 50% 50%); }
.gw-piece.oval { border-radius: 50%; }
.gw-piece.oval .gw-art { clip-path: ellipse(48.6% 48.6% at 50% 50%); }
.gw-piece.box .gw-art { clip-path: inset(1% round 9%); }
/* square crops would lift their background with them, so these stay put and rely on the spotlight */
.gw-piece.box .gw-lift { display: none; }
.gw-piece.on .gw-lift {
  opacity: 1; transform: scale(1.04);
  filter: drop-shadow(0 1.6cqw 2.4cqw rgba(0,0,0,.22)) drop-shadow(0 .3cqw .5cqw rgba(0,0,0,.14));
}
/* mugs rise off their shelf: grow from the base */
.gw-piece.mug .gw-lift, .gw-piece.box .gw-lift, .gw-piece.oval .gw-lift { transform-origin: 50% 100%; }
.gw-piece.mug.on .gw-lift, .gw-piece.box.on .gw-lift { transform: scale(1.06); }
.gw-piece:focus-visible .gw-lift { outline: 2px solid var(--blue); outline-offset: 6px; border-radius: inherit; }

/* the wall label, cropped from the photo, lights up above the dimming */
.gw-label {
  position: absolute; pointer-events: none;
  opacity: 0; transform: translateY(0); transition: opacity .3s var(--ease), transform .4s var(--ease), box-shadow .4s;
}
.gw-label.on { opacity: 1; transform: translateY(-.2cqw); box-shadow: 0 .8cqw 1.8cqw rgba(0,0,0,.14); }

.gw-label.drawn {
  display: grid; gap: .35cqw; padding: .9cqw 1cqw; background: #FBF9F4; color: var(--ink);
  border: 1px solid rgba(10,10,10,.08); transform: translateY(.6cqw);
}
.gw-label.drawn.on { transform: none; }
.dl-n { font-size: max(11px, .92cqw); font-weight: 700; }
.dl-d { font-size: max(10px, .78cqw); color: var(--grey); }

/* acquire tag that slides out from under the label */
.gw-tag {
  position: absolute; display: flex; justify-content: space-between; align-items: center; gap: .6cqw;
  padding: .7cqw .9cqw; background: var(--ink); color: var(--cream);
  font-size: max(11px, .95cqw); font-weight: 700; white-space: nowrap;
  opacity: 0; transform: translateY(-.8cqw); pointer-events: none;
  transition: opacity .3s var(--ease), transform .4s var(--ease), background .2s;
}
.gw-tag span::after { content: ' ←'; }
html[dir="ltr"] .gw-tag span::after { content: ' →'; }
.gw-tag.on { opacity: 1; transform: none; pointer-events: auto; transition-delay: .08s; }
.gw-tag:hover { background: var(--blue); }

/* narrow screens: keep the wall readable and let it scroll sideways */
/* the tour card only exists on phones */
.gw-card { display: none; }

/* phones and portrait tablets: the same full-screen hero, toured piece by piece */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px) {
  .gw-head { padding: 12px 16px 40px; gap: 4px 12px; flex-wrap: nowrap; }
  .gw-eyebrow, .gw-hint, .gw-dots .t { display: none; }
  .gw-title { font-size: clamp(20px, 6vw, 30px); }
  .gw-ctrl { gap: 10px; }
  .gw-dots { gap: 10px; }
  .gw-arrows button { width: 34px; height: 34px; font-size: 13px; }
  /* the whole photo at full height, scrolled sideways by hand or by the tour */
  .gw-scroll { overflow-x: auto; overflow-y: hidden; direction: ltr; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .gw-frame {
    position: relative; left: auto; top: auto; translate: none;
    width: calc(var(--avail) * var(--ratio, 1.777)); height: var(--avail);
  }
  .gw-frame > * { direction: rtl; }
  html[dir="ltr"] .gw-frame > * { direction: ltr; }
  .gw-tag, .gw-label.drawn { display: none; }
  .gw-cap h2 { font-size: 5.4cqw; }

  .gw-card {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    position: absolute; z-index: 6; inset-inline: 12px; bottom: 12px;
    padding: 14px 14px 14px 16px; border-radius: 16px;
    background: rgba(251, 249, 244, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px -12px rgba(0,0,0,.3);
    transition: bottom .6s var(--ease), top .6s var(--ease);
  }
  /* pieces low in the photo: the card moves up under the title */
  .gw-card.top { bottom: auto; top: 64px; }
  .gc-txt { display: grid; gap: 2px; min-width: 0; }
  .gc-n { font-size: 11px; font-weight: 700; color: var(--grey); }
  .gc-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gc-d { font-size: 12px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gc-buy {
    flex: none; display: grid; justify-items: center; gap: 1px; padding: 9px 14px; border-radius: 12px;
    background: var(--ink); color: var(--cream); font-size: 12px; font-weight: 700;
  }
  .gc-buy b { font-size: 14px; }
  .gc-txt, .gc-buy { opacity: 0; transform: translateY(6px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  .gw-card.in .gc-txt, .gw-card.in .gc-buy { opacity: 1; transform: none; }
  .gw-card.in .gc-buy { transition-delay: .06s; }
}

@media (prefers-reduced-motion: reduce) {
  .gw-frame, .gw-dim, .gw-lift, .gw-label, .gw-tag, .gw-slide, .gw-slide .gw-img, .gw-cap, .gc-txt, .gc-buy { transition: none !important; }
  .gw-hint i { animation: none; }
}
