/* The Exhibition · the homepage rooms (loads after base.css) */

/* ------------------------------------------------------------------ the loading veil (shown once per visit) */
.veil { display: none; }
.veiled .veil {
  position: fixed;
  inset: 0;
  z-index: var(--z-veil);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  padding: calc(var(--edge) * 0.8) var(--edge);
  background: var(--stone);
  color: var(--ink);
}
.veil__side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.veil__side--right { grid-column: 2; text-align: right; }
.veil__side--left .mask:first-child { font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.mask { display: block; overflow: hidden; }
.mask > span { display: block; }
.veil__count {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: start;
  display: flex;
  overflow: hidden;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(7rem, 4rem + 16vw, 18rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.drum { position: relative; display: block; height: 1em; overflow: hidden; }
.drum__strip { display: flex; flex-direction: column; }
.drum__strip span { display: block; height: 1em; text-align: center; }
.veiled body { overflow: hidden; }

/* ================================================================== ROOM 1 · the exhibit */
.hero { position: relative; }
.hero__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  gap: clamp(14px, 2.2vh, 26px);
  min-height: 100svh;
  padding: calc(var(--nav) + clamp(14px, 3vh, 34px)) var(--edge) clamp(20px, 4vh, 40px);
}
.hero__line {
  position: relative;
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--hero-size, clamp(3.2rem, 1rem + 9vw, 10rem));
  line-height: 0.86;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero__ink { display: inline-block; }
.hero__line--top { justify-self: start; z-index: 1; }
.hero__line--bottom { justify-self: end; z-index: 4; text-align: right; padding-bottom: 0.16em; }
.br-narrow { display: none; }
.hero__slot {
  position: relative;
  justify-self: center;
  width: min(36vw, 600px);
  min-height: 220px;
}
.hero__frame { position: absolute; inset: 0; overflow: hidden; background: var(--sand); }
.hero__frame picture,
.hero__frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__shade { position: absolute; inset: 0; background: var(--ink); opacity: 0; pointer-events: none; }
.hero__still {
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: auto;
  height: 132%;
  transform: translateX(-50%);
  pointer-events: none;
}
.hero__foot { display: flex; flex-wrap: wrap; gap: 12px; z-index: 5; }
.hero__mango { display: none; }

/* the origin: without motion it is its own band under the poster, the orchard behind it */
.hero__portal { grid-column: 1; }
.origin {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 28px;
  margin: 24px calc(var(--edge) * -1) calc(clamp(20px, 4vh, 40px) * -1);
  padding: clamp(80px, 16vh, 180px) var(--edge) clamp(48px, 8vh, 96px);
  color: var(--paper);
  background: var(--ink) url('../img/orchard.webp') center / cover no-repeat;
}
.origin::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgb(28 33 36 / 0.55); }
.origin__lead { display: grid; gap: 16px; }
.origin__big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 1.4rem + 6.6vw, 8.2rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  max-width: 10ch;
}
.origin__small { font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem); max-width: 34ch; }

@media (max-width: 760px) {
  .hero__stage { grid-template-rows: auto minmax(200px, 1fr) auto auto; }
  .br-narrow { display: inline; }
  .hero__slot { width: min(78vw, 420px); }
  .hero__foot .button { flex: 1 1 auto; }
}

/* ---- with motion: a sticky stage, the frame becomes a full-stage layer clipped to the slot ---- */
.motion .hero { height: 330vh; }
.motion .hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  min-height: 0;
  overflow: clip;
}
.motion .hero__slot { position: static; width: min(36vw, 600px); }
.motion .hero__frame {
  inset: 0;
  z-index: 2;
  background: var(--sand);
  transform-origin: 50% 50%;
  will-change: transform;
}
.motion .hero__frame picture { display: block; transform-origin: 50% 50%; will-change: transform; }
.motion .hero__still { display: none; }
.motion .hero__portal {
  position: absolute;
  grid-column: auto;
  grid-row: auto;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.motion .hero__mango { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.motion .origin {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: calc(var(--nav) + 4vh) var(--edge) clamp(28px, 7vh, 72px);
  align-content: end;
  background: none;
  isolation: auto;
}
.motion .origin::before { display: none; }
.motion .origin__lead { visibility: hidden; }
.motion .specimen { display: block; }
.motion .specimen__tag {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
}
.motion .specimen__lines {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.motion .hero__foot { align-self: end; }
/* before the intro: the lines, the frame and the buttons wait */
.motion.intro .hero__ink { opacity: 0; }
.motion.intro .hero__foot { opacity: 0; visibility: hidden; }
.motion.intro .hero__frame { visibility: hidden; }
@media (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
  .hero__slot,
  .motion .hero__slot { width: min(58vw, 560px); }
}
@media (max-width: 760px) {
  .motion .hero { height: 300vh; }
  .motion .hero__slot { width: min(78vw, 420px); }
  .motion .specimen { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .motion .specimen__tag { position: static; }
  .motion .specimen__lines { display: none; }
  .specimen__value { font-size: 1.2rem; }
}
/* no WebGL (or no model): the still mango takes the canvas's place, moved by the same script */
.motion.no-webgl .hero__mango,
.motion.no-mango .hero__mango { display: none; }
.motion.no-webgl .hero__still,
.motion.no-mango .hero__still {
  display: block;
  left: 0;
  top: 0;
  bottom: auto;
  height: auto;
  transform-origin: 0 0;
}

/* ================================================================== ROOM 2 · the collection */
.collection { position: relative; padding: clamp(96px, 14vh, 160px) var(--edge) clamp(64px, 10vh, 120px); }
.collection__stage { max-width: var(--wide); margin: 0 auto; }
.collection__head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vh, 64px); }
.collection__canvas { display: none; }
.crops {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.crop__link {
  display: grid;
  gap: 6px;
  height: 100%;
  padding-bottom: 16px;
  text-decoration: none;
  background: var(--paper);
}
.crop__photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; }
.crop__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.crop__name { padding: 10px 16px 0; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.crop__line { padding: 0 16px; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.crop__peak { padding: 0 16px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay); }
@media (hover: hover) and (pointer: fine) {
  .crop__link:hover .crop__photo img { transform: scale(1.04); }
}
@media (max-width: 1100px) { .crops { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .crops { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .crops { grid-template-columns: minmax(0, 1fr); } }
.collection__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.ribbon-control { display: flex; align-items: center; gap: 4px; }
.ribbon-control[hidden] { display: none; }
.ribbon-control__step {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--ink);
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.ribbon-control__step:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .ribbon-control__step:hover { background: var(--ink); color: var(--paper); }
}
.ribbon-control__now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15ch;
  min-height: 48px;
  padding: 0 18px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}
.ribbon-control__now::after { content: '\2192'; margin-left: 10px; font-family: var(--sans); font-size: 1rem; }

/* ---- with motion and WebGL: a sticky stage, the canvas paints the crops ---- */
.motion.webgl .collection { padding: 0; }
.motion.webgl .collection__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  max-width: none;
  overflow: hidden;
}
.motion.webgl .collection__canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}
.motion.webgl .is-over-card .collection__canvas { cursor: pointer; }
.motion.webgl .collection__head {
  position: absolute;
  top: calc(var(--nav) + clamp(18px, 4vh, 44px));
  left: var(--edge);
  z-index: 2;
  max-width: min(760px, calc(100% - 2 * var(--edge)));
  margin: 0;
  pointer-events: none;
}
.motion.webgl .collection__head { max-width: calc(100% - 2 * var(--edge)); }
.motion.webgl .collection__head .title { font-size: clamp(2rem, 0.9rem + 2.6vw, 3.6rem); }
.motion.webgl .collection__head .title em { display: inline; }
.motion.webgl .collection__head .lede { max-width: 78ch; font-size: 1.02rem; }
.motion.webgl .crops {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.motion.webgl .collection__foot {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  bottom: clamp(18px, 4vh, 40px);
  z-index: 2;
  margin: 0;
}
@media (max-width: 760px) {
  .motion.webgl .collection__head .lede { font-size: 0.9rem; line-height: 1.5; }
  .motion.webgl .collection__foot { justify-content: center; }
  .motion.webgl .collection__foot .textlink { order: 2; }
}

/* ================================================================== ROOM 3 · how we work */
.how { padding: clamp(96px, 16vh, 180px) 0 0; }
.how__head { max-width: var(--wide); margin: 0 auto clamp(40px, 7vh, 80px); padding: 0 var(--edge); }
.drawer {
  --top: calc(var(--nav) + 20px);
  --tab: 48px;
  --slant: 22px;
  --body: min(calc(100svh - var(--top) - var(--tab) - 28px), 560px);
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--edge);
}
.drawer::after { content: ''; display: block; height: 30vh; }
.folder {
  --tint: var(--paper);
  --on: var(--ink);
  --on-soft: var(--muted);
  position: sticky;
  top: var(--top);
  margin: 0 0 16vh;
  transform: translateY(var(--rise, 0px));
  pointer-events: none;
}
.folder--sand { --tint: var(--sand); --on-soft: #43494b; }
.folder--clay { --tint: var(--clay); --on: var(--paper); --on-soft: #f6e6df; }
.folder--ink { --tint: var(--ink); --on: var(--paper); --on-soft: var(--on-ink-muted); }
.folder__row { height: var(--tab); }
.folder__tab {
  position: relative;
  display: flex;
  align-items: center;
  width: calc(100% / var(--count) - var(--slant));
  height: 100%;
  margin-left: calc(var(--n) * 100% / var(--count));
  padding: 0 6px 0 18px;
  border: 0;
  background: var(--tint);
  color: var(--on);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}
.folder__tab::after {
  content: '';
  position: absolute;
  left: calc(100% - 0.5px);
  top: 0;
  width: calc(var(--slant) + 0.5px);
  height: 100%;
  background: inherit;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.folder__tab > span { display: inline-block; overflow: hidden; text-overflow: ellipsis; opacity: 0.72; transition: opacity 250ms ease; }
.folder__num { margin-right: 0.3em; }
.folder.is-front .folder__tab > span,
.folder__tab:hover > span,
.folder__tab:focus-visible > span { opacity: 1; }
.folder__tab:focus-visible { outline-offset: -4px; outline-color: var(--on); }
.folder__body {
  height: var(--body);
  overflow: hidden;
  background: var(--tint);
  color: var(--on);
  box-shadow: 0 -16px 40px rgb(28 33 36 / 0.12);
  pointer-events: auto;
}
.folder__inside {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 4vw, 64px);
  height: 100%;
  padding: clamp(22px, 3.4vw, 52px);
  opacity: var(--fade, 1);
}
.folder__text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.folder__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 1.3rem + 3.4vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.015em;
}
.folder__line { max-width: 40ch; color: var(--on-soft); font-size: clamp(1rem, 0.94rem + 0.3vw, 1.18rem); line-height: 1.6; }
.folder__text .textlink { margin-top: auto; }
.folder__art {
  position: relative;
  min-height: 0;
  border: 1.5px solid var(--on);
}
.folder__art img { width: 100%; height: 100%; object-fit: cover; }
.folder__art i {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -6px;
  border: 1.5px solid var(--on);
  background: var(--tint);
}
.folder__art i:nth-of-type(1) { left: 0; top: 0; }
.folder__art i:nth-of-type(2) { left: 100%; top: 0; }
.folder__art i:nth-of-type(3) { left: 0; top: 100%; }
.folder__art i:nth-of-type(4) { left: 100%; top: 100%; }
@media (max-width: 760px) {
  .drawer { --tab: 44px; --slant: 12px; }
  .folder__tab { padding-left: 10px; font-size: 0.66rem; letter-spacing: 0.02em; }
  .folder__inside { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .folder__name { display: none; }
  .folder__num { margin-right: 0; }
  .folder__tab { padding-left: 12px; font-size: 0.8rem; }
}

/* ================================================================== ROOM 4 · markets */
.markets { max-width: var(--wide); margin: 0 auto; padding: clamp(96px, 14vh, 160px) var(--edge) clamp(96px, 16vh, 180px); }
.markets__head { display: grid; gap: 20px; margin-bottom: clamp(40px, 7vh, 80px); }
.markets__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}
.market { display: grid; gap: 16px; }
.market--europe { grid-column: 1 / span 7; }
.market--uae { grid-column: 9 / span 4; margin-top: clamp(80px, 18vh, 220px); }
.market__frame { position: relative; overflow: hidden; background: var(--sand); }
.market--europe .market__frame { aspect-ratio: 4 / 3; }
.market--uae .market__frame { aspect-ratio: 3 / 4; }
.market__frame picture,
.market__frame img { width: 100%; height: 100%; object-fit: cover; }
.market__caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-top: 4px; border-top: 1px solid var(--hair); }
.market__caption strong { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); font-weight: 600; line-height: 1.2; }
.market__caption span { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.blinds { position: absolute; inset: 0; z-index: 1; display: flex; pointer-events: none; }
.blinds span { flex: 1; margin-right: -1px; background: var(--stone); transform-origin: 50% 0; }
@media (max-width: 760px) {
  .market--europe,
  .market--uae { grid-column: 1 / -1; margin-top: 0; }
  .market--uae { width: 78%; justify-self: end; }
}

/* ================================================================== ROOM 5 · the finale */
.finale { position: relative; }
.finale__stage {
  position: relative;
  display: grid;
  gap: 32px;
  padding: clamp(80px, 14vh, 160px) var(--edge);
}
.finale__copy { display: grid; gap: 18px; max-width: 640px; z-index: 2; }
.echo { display: none; }
.drop {
  justify-self: start;
  display: inline-flex;
  color: var(--paper);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.drop__press { display: block; width: 100%; height: 100%; transition: transform 160ms var(--ease-out); }
.drop__body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 56px;
  padding: 0 30px;
  background: var(--clay);
  transition: background-color 300ms var(--ease-out);
}
.drop__label { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.drop:active .drop__press { transform: scale(0.97); }
.drop:focus-visible { outline: none; }
.drop:focus-visible .drop__body { box-shadow: 0 0 0 3px var(--stone), 0 0 0 6px var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .drop:hover .drop__body { background: var(--ink); }
}

/* ---- with motion: the word repeats in steps and its last letter falls to become the button ---- */
.motion .finale { height: calc(100lvh + 190vh); }
.motion .finale__stage {
  position: sticky;
  top: 0;
  display: block;
  height: 100vh;
  height: 100lvh;
  padding: 0;
  overflow: hidden;
}
.motion .finale__copy {
  position: absolute;
  top: calc(var(--nav) + clamp(18px, 4vh, 44px));
  left: var(--edge);
  max-width: min(640px, calc(100% - 2 * var(--edge)));
}
.motion .echo {
  display: block;
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-size: 20vw;
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.045em;
  white-space: nowrap;
  color: var(--ink);
}
.echo__measure { visibility: hidden; }
.echo__copy { position: absolute; inset: 0; isolation: isolate; transform-origin: 50% 100%; }
/* the echoes step down in tone towards the front word, like relief cut into the stone */
.echo__copy:nth-child(2) { color: #d3ccbd; }
.echo__copy:nth-child(3) { color: #bab2a3; }
.echo__copy:nth-child(4) { color: #938e85; }
.echo__copy:nth-child(5) { color: #5f6264; }
.echo__copy--front { color: var(--ink); }
/* each plate starts at the x-height, so the copies behind show only the tops of their letters, like steps */
.echo__plate { position: absolute; z-index: -1; inset: 34% -60% -8% -60%; background: var(--stone); }
.echo__letter { display: inline-block; }
.echo__base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.echo--ready .echo__copy--front [data-stem] { visibility: hidden; }
.motion .drop {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
  outline: none;
}
.motion .drop .drop__body {
  min-height: 0;
  padding: 0;
  background: var(--ink);
  transform-origin: 100% 50%;
}
.motion .drop .drop__label {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: var(--label, 16px);
  transform: translate(-50%, -50%) rotate(-90deg);
}
.motion .drop.is-down { pointer-events: auto; cursor: pointer; }
.motion .drop.is-down .drop__body { background: var(--clay); }
@media (hover: hover) and (pointer: fine) {
  .motion .drop.is-down:hover .drop__body { background: #8e2f15; }
}

@media (prefers-contrast: more) {
  .origin::before { background: rgb(28 33 36 / 0.75); }
}
